Merging backout.
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 30 Sep 2010 17:05:19 -0700
changeset 54824 4ace6b349a3cae691204e3e740c807ef4d9faad8
parent 54823 198346fcc178bc40188ae10d9e06bae685f1b505 (current diff)
parent 54822 b57b428e8e7100de54ae94ff723719665222936a (diff)
child 54825 b343269c3aa4d72582a07b237352417943922c45
push id16042
push usermlamouri@mozilla.com
push dateFri, 01 Oct 2010 00:12:59 +0000
treeherdermozilla-central@669eb2d837d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b7pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merging backout.
browser/base/content/credits.xhtml
browser/branding/nightly/content/aboutCredits.png
browser/branding/nightly/content/aboutFooter.png
browser/branding/unofficial/content/aboutCredits.png
browser/branding/unofficial/content/aboutFooter.png
browser/locales/en-US/chrome/browser/credits.dtd
browser/themes/gnomestripe/browser/sync-usedBefore.png
browser/themes/gnomestripe/browser/sync-usedNever.png
browser/themes/gnomestripe/browser/tabbrowser/progress-pulsing.png
browser/themes/gnomestripe/browser/tabbrowser/progress.png
browser/themes/pinstripe/browser/Search-addengines.png
browser/themes/pinstripe/browser/feed-icons.png
browser/themes/pinstripe/browser/sync-16-throbber.png
browser/themes/pinstripe/browser/sync-usedBefore.png
browser/themes/pinstripe/browser/sync-usedNever.png
browser/themes/pinstripe/browser/tabbrowser/progress-pulsing.png
browser/themes/pinstripe/browser/tabbrowser/progress.png
browser/themes/winstripe/browser/Search-addengines.png
browser/themes/winstripe/browser/feeds/feed-icons-16-aero.png
browser/themes/winstripe/browser/feeds/feed-icons-16.png
browser/themes/winstripe/browser/sync-16-throbber.png
browser/themes/winstripe/browser/sync-usedBefore.png
browser/themes/winstripe/browser/sync-usedNever.png
browser/themes/winstripe/browser/tabbrowser/progress-pulsing.png
browser/themes/winstripe/browser/tabbrowser/progress.png
build/macosx/universal/mozconfig-64
content/base/test/chrome/bug514705.html
content/base/test/chrome/bug514705_helper.xul
content/base/test/chrome/test_bug514705.xul
content/html/content/src/nsGenericHTMLElement.h
content/html/content/src/nsHTMLFormElement.cpp
content/html/content/test/Makefile.in
content/media/test/test_timeupdate3.html
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
dom/interfaces/html/nsIDOMHTMLVoidCallback.idl
dom/interfaces/notification/nsIDesktopNotificationPrompt.idl
dom/ipc/TabTypes.h
dom/src/geolocation/nsGeolocationOOP.h
extensions/reporter/Makefile.in
extensions/reporter/install.rdf
extensions/reporter/jar.mn
extensions/reporter/locales/Makefile.in
extensions/reporter/locales/en-US/chrome/about.dtd
extensions/reporter/locales/en-US/chrome/reportResults.dtd
extensions/reporter/locales/en-US/chrome/reportWizard.dtd
extensions/reporter/locales/en-US/chrome/reportWizard.properties
extensions/reporter/locales/en-US/chrome/reporter.dtd
extensions/reporter/locales/en-US/chrome/reporterOverlay.dtd
extensions/reporter/locales/en-US/chrome/reporterOverlay.properties
extensions/reporter/locales/jar.mn
extensions/reporter/locales/l10n.ini
extensions/reporter/makefiles.sh
extensions/reporter/resources/content/prefs/reporter.js
extensions/reporter/resources/content/reporter/about.xul
extensions/reporter/resources/content/reporter/error.xhtml
extensions/reporter/resources/content/reporter/report.xhtml
extensions/reporter/resources/content/reporter/reportWizard.js
extensions/reporter/resources/content/reporter/reportWizard.xul
extensions/reporter/resources/content/reporter/reporterOverlay.js
extensions/reporter/resources/content/reporter/reporterOverlay.xul
extensions/reporter/resources/skin/classic/reporter/icon.png
extensions/reporter/resources/skin/classic/reporter/reportResults.css
extensions/reporter/resources/skin/classic/reporter/reportWizard.css
extensions/reporter/resources/skin/classic/reporter/splash.png
js/src/jsapi-tests/testSeal.cpp
js/src/jsdtracef.cpp
js/src/jsdtracef.h
js/src/jsrecursion.cpp
js/src/jstask.cpp
js/src/jstask.h
js/src/lirasm/tests/f2i.in
js/src/lirasm/tests/f2i.out
js/src/tests/js1_5/extensions/regress-449657.js
js/src/trace-test/tests/basic/testCrossGlobalCall.js
js/src/trace-test/tests/bug579740.js
js/src/trace-test/tests/testPutOnEmptyArgsObject.js
layout/style/nsCSSRule.cpp
modules/zlib/src/algorithm.txt
modules/zlib/src/gzio.c
modules/zlib/src/zlib.3
netwerk/protocol/http/nsHttpChannel.cpp
other-licenses/branding/firefox/content/aboutCredits.png
other-licenses/branding/firefox/content/aboutFooter.png
security/patches/maemo-rpath-link.patch
security/patches/msvc-aslr.patch
services/sync/tests/unit/test_service_checkUsername.js
testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js
testing/mozmill/jsbridge-2.3.5/MANIFEST.in
testing/mozmill/jsbridge-2.3.5/PKG-INFO
testing/mozmill/jsbridge-2.3.5/jsbridge/__init__.py
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/chrome.manifest
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/chrome/content/overlay.js
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/chrome/content/overlay.xul
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/components/cmdarg.js
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/install.rdf
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/resource/modules/events.js
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/resource/modules/init.js
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/resource/modules/json2.js
testing/mozmill/jsbridge-2.3.5/jsbridge/extension/resource/modules/server.js
testing/mozmill/jsbridge-2.3.5/jsbridge/jsobjects.py
testing/mozmill/jsbridge-2.3.5/jsbridge/network.py
testing/mozmill/jsbridge-2.3.5/jsbridge/xpi/chromebug-0.5.0a1.xpi
testing/mozmill/jsbridge-2.3.5/jsbridge/xpi/firebug-1.4.0a3.xpi
testing/mozmill/jsbridge-2.3.5/jsbridge/xpi/javascript_debugger-0.9.87.4-fx+tb+sb+sm.xpi
testing/mozmill/jsbridge-2.3.5/jsbridge/xpi/mozlab-current-0.1.9.2008050521.xpi
testing/mozmill/jsbridge-2.3.5/jsbridge/xpi/xush-0.2-fx.xpi
testing/mozmill/jsbridge-2.3.5/setup.cfg
testing/mozmill/jsbridge-2.3.5/setup.py
testing/mozmill/mozmill-1.4.1/MANIFEST.in
testing/mozmill/mozmill-1.4.1/PKG-INFO
testing/mozmill/mozmill-1.4.1/docs/Makefile
testing/mozmill/mozmill-1.4.1/docs/_build/doctrees/environment.pickle
testing/mozmill/mozmill-1.4.1/docs/_build/doctrees/index.doctree
testing/mozmill/mozmill-1.4.1/docs/_build/html/_sources/index.txt
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/contents.png
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/default.css
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/doctools.js
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/file.png
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/jquery.js
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/minus.png
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/navigation.png
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/plus.png
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/pygments.css
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/rightsidebar.css
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/searchtools.js
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/sphinxdoc.css
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/stickysidebar.css
testing/mozmill/mozmill-1.4.1/docs/_build/html/_static/traditional.css
testing/mozmill/mozmill-1.4.1/docs/_build/html/genindex.html
testing/mozmill/mozmill-1.4.1/docs/_build/html/index.html
testing/mozmill/mozmill-1.4.1/docs/_build/html/modindex.html
testing/mozmill/mozmill-1.4.1/docs/_build/html/objects.inv
testing/mozmill/mozmill-1.4.1/docs/_build/html/search.html
testing/mozmill/mozmill-1.4.1/docs/_build/html/searchindex.js
testing/mozmill/mozmill-1.4.1/docs/conf.py
testing/mozmill/mozmill-1.4.1/docs/index.rst
testing/mozmill/mozmill-1.4.1/mozmill/__init__.py
testing/mozmill/mozmill-1.4.1/mozmill/extension/build.xml
testing/mozmill/mozmill-1.4.1/mozmill/extension/chrome-jar.manifest
testing/mozmill/mozmill-1.4.1/mozmill/extension/chrome.manifest
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/mozmill.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-icons_222222_256x240.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-icons_2e83ff_256x240.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-icons_454545_256x240.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-icons_888888_256x240.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/images/ui-icons_cd0a0a_256x240.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/css/smoothness/jquery-ui-1.7.1.custom.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/dx.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/dxwindow.xul
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/change_log.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/about.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/compatibility.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/configuration.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/credits.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/customization_language.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/customization_plugin.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/customization_syntax.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/doc_style.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/include.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/index.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/installation.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/javascript_functions.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/docs/license.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/autocompletion.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_compressor.php
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_full.gz
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_full.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_full_with_plugins.gz
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_full_with_plugins.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_functions.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/edit_area_loader.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/elements_functions.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/highlight.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/autocompletion.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/close.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/fullscreen.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/go_to_line.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/help.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/highlight.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/load.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/move.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/newdocument.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/opacity.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/processing.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/redo.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/reset_highlight.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/save.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/search.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/smooth_selection.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/spacer.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/statusbar_resize.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/undo.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/images/word_wrap.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/keyboard.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/bg.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/cs.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/de.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/dk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/en.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/eo.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/es.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/fi.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/fr.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/hr.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/it.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/ja.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/mk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/nl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/pl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/pt.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/ru.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/sk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/langs/zh.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/license_apache.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/license_bsd.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/license_lgpl.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/manage_area.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/charmap.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/css/charmap.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/images/charmap.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/jscripts/map.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/bg.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/cs.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/de.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/dk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/en.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/eo.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/es.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/fr.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/hr.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/it.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/ja.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/mk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/nl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/pl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/pt.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/ru.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/sk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/langs/zh.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/charmap/popup.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/css/test.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/images/Thumbs.db
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/images/test.gif
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/bg.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/cs.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/de.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/dk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/en.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/eo.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/es.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/fr.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/hr.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/it.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/ja.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/mk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/nl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/pl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/pt.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/ru.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/sk.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/langs/zh.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/test.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/plugins/test/test2.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/basic.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/brainfuck.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/c.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/coldfusion.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/cpp.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/css.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/html.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/java.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/js.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/pas.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/perl.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/php.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/python.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/robotstxt.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/ruby.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/sql.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/tsql.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/vb.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/reg_syntax/xml.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/regexp.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/resize_area.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/search_replace.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/edit_area/template.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/exemples/exemple_full.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/license_apache.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/license_bsd.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/license_lgpl.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/editarea/todo.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/img/wmIcon.png
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/jquery/jquery-1.3.2.min.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/jquery/jquery-ui-1.7.1.custom.min.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/menus.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/mozmill.html
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/mozmill.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/mozmill.xul
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/output.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/overlay.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/overlay.xul
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/overlay_tb.xul
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/prefs.xul
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/rec.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/shell.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/shortcuts.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/testwindow.xul
testing/mozmill/mozmill-1.4.1/mozmill/extension/content/ui.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/defaults/preferences/debug.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/install.rdf
testing/mozmill/mozmill-1.4.1/mozmill/extension/locale/en-US/mozmill.dtd
testing/mozmill/mozmill-1.4.1/mozmill/extension/locale/en-US/overlay.dtd
testing/mozmill/mozmill-1.4.1/mozmill/extension/mozmill.xpi
testing/mozmill/mozmill-1.4.1/mozmill/extension/readme.txt
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/EventUtils.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/controller.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/elementslib.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/events.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/frame.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/init.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/inspection.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/jum.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/mozmill.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/modules/utils.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/arrays.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/dom.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/httpd.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/json2.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/objects.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/os.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/strings.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/resource/stdlib/withs.js
testing/mozmill/mozmill-1.4.1/mozmill/extension/skin/overlay.css
testing/mozmill/mozmill-1.4.1/mozmill/extension/zipexclude.lst
testing/mozmill/mozmill-1.4.1/setup.cfg
testing/mozmill/mozmill-1.4.1/setup.py
testing/mozmill/mozmill-1.4.1/test/test_python_callbacks_callbacks.py
testing/mozmill/mozrunner-2.4.2/PKG-INFO
testing/mozmill/mozrunner-2.4.2/mozrunner/__init__.py
testing/mozmill/mozrunner-2.4.2/mozrunner/killableprocess.py
testing/mozmill/mozrunner-2.4.2/mozrunner/qijo.py
testing/mozmill/mozrunner-2.4.2/mozrunner/winprocess.py
testing/mozmill/mozrunner-2.4.2/mozrunner/wpk.py
testing/mozmill/mozrunner-2.4.2/setup.cfg
testing/mozmill/mozrunner-2.4.2/setup.py
testing/mozmill/tests/addons/readme.txt
testing/mozmill/tests/addons/toolbar@google.com/testToolbarInstalled.js
testing/mozmill/tests/firefox/crashTests/testRemoveCookieAfterPrivateBrowsing.js
testing/mozmill/tests/firefox/helperClasses/testAddonsAPI.js
testing/mozmill/tests/firefox/helperClasses/testDownloadsAPI.js
testing/mozmill/tests/firefox/helperClasses/testPreferencesDialog.js
testing/mozmill/tests/firefox/helperClasses/testSearchAPI.js
testing/mozmill/tests/firefox/helperClasses/testSessionStoreAPI.js
testing/mozmill/tests/firefox/readme.txt
testing/mozmill/tests/firefox/restartTests/testDefaultBookmarks/test1.js
testing/mozmill/tests/firefox/restartTests/testExtensionInstallGetAddons/test1.js
testing/mozmill/tests/firefox/restartTests/testExtensionInstallGetAddons/test2.js
testing/mozmill/tests/firefox/restartTests/testExtensionInstallUninstall/test1.js
testing/mozmill/tests/firefox/restartTests/testExtensionInstallUninstall/test2.js
testing/mozmill/tests/firefox/restartTests/testExtensionInstallUninstall/test3.js
testing/mozmill/tests/firefox/restartTests/testMasterPassword/test1.js
testing/mozmill/tests/firefox/restartTests/testThemeInstallUninstall/test1.js
testing/mozmill/tests/firefox/restartTests/testThemeInstallUninstall/test2.js
testing/mozmill/tests/firefox/restartTests/testThemeInstallUninstall/test3.js
testing/mozmill/tests/firefox/softwareUpdate/testDirectUpdate/test1.js
testing/mozmill/tests/firefox/softwareUpdate/testDirectUpdate/test2.js
testing/mozmill/tests/firefox/softwareUpdate/testFallbackUpdate/test1.js
testing/mozmill/tests/firefox/softwareUpdate/testFallbackUpdate/test2.js
testing/mozmill/tests/firefox/softwareUpdate/testFallbackUpdate/test3.js
testing/mozmill/tests/firefox/testAddons/files/plugin.html
testing/mozmill/tests/firefox/testAddons/testDisableEnablePlugin.js
testing/mozmill/tests/firefox/testAddons/testGetAddons.js
testing/mozmill/tests/firefox/testAddons/testSearchAddons.js
testing/mozmill/tests/firefox/testAwesomeBar/testAccessLocationBar.js
testing/mozmill/tests/firefox/testAwesomeBar/testCheckItemHighlight.js
testing/mozmill/tests/firefox/testAwesomeBar/testEscapeAutocomplete.js
testing/mozmill/tests/firefox/testAwesomeBar/testLocationBarSearches.js
testing/mozmill/tests/firefox/testAwesomeBar/testSuggestHistoryBookmarks.js
testing/mozmill/tests/firefox/testAwesomeBar/testVisibleItemsMax.js
testing/mozmill/tests/firefox/testBookmarks/testAddBookmarkToMenu.js
testing/mozmill/tests/firefox/testCookies/testDisableCookies.js
testing/mozmill/tests/firefox/testCookies/testEnableCookies.js
testing/mozmill/tests/firefox/testCookies/testRemoveAllCookies.js
testing/mozmill/tests/firefox/testCookies/testRemoveCookie.js
testing/mozmill/tests/firefox/testDownloading/testCloseDownloadManager.js
testing/mozmill/tests/firefox/testDownloading/testDownloadStates.js
testing/mozmill/tests/firefox/testDownloading/testOpenDownloadManager.js
testing/mozmill/tests/firefox/testFindInPage/testFindInPage.js
testing/mozmill/tests/firefox/testFormManager/testAutoCompleteOff.js
testing/mozmill/tests/firefox/testFormManager/testBasicFormCompletion.js
testing/mozmill/tests/firefox/testFormManager/testClearFormHistory.js
testing/mozmill/tests/firefox/testFormManager/testDisableFormManager.js
testing/mozmill/tests/firefox/testGeneral/testBackForwardButtons.js
testing/mozmill/tests/firefox/testGeneral/testGoogleSuggestions.js
testing/mozmill/tests/firefox/testGeneral/testStopReloadButtons.js
testing/mozmill/tests/firefox/testInstallation/testBreakpadInstalled.js
testing/mozmill/tests/firefox/testLayout/testNavigateFTP.js
testing/mozmill/tests/firefox/testPasswordManager/testPasswordNotSaved.js
testing/mozmill/tests/firefox/testPasswordManager/testPasswordSavedAndDeleted.js
testing/mozmill/tests/firefox/testPopups/testPopupsAllowed.js
testing/mozmill/tests/firefox/testPopups/testPopupsBlocked.js
testing/mozmill/tests/firefox/testPreferences/testPaneRetention.js
testing/mozmill/tests/firefox/testPreferences/testPreferredLanguage.js
testing/mozmill/tests/firefox/testPreferences/testRestoreHomepageToDefault.js
testing/mozmill/tests/firefox/testPreferences/testSwitchPanes.js
testing/mozmill/tests/firefox/testPrivateBrowsing/files/geolocation.html
testing/mozmill/tests/firefox/testPrivateBrowsing/testAboutPrivateBrowsing.js
testing/mozmill/tests/firefox/testPrivateBrowsing/testDisabledElements.js
testing/mozmill/tests/firefox/testPrivateBrowsing/testDisabledPermissions.js
testing/mozmill/tests/firefox/testPrivateBrowsing/testDownloadManagerClosed.js
testing/mozmill/tests/firefox/testPrivateBrowsing/testGeolocation.js
testing/mozmill/tests/firefox/testPrivateBrowsing/testTabsDismissedOnStop.js
testing/mozmill/tests/firefox/testSearch/testAddMozSearchProvider.js
testing/mozmill/tests/firefox/testSearch/testFocusAndSearch.js
testing/mozmill/tests/firefox/testSearch/testGetMoreSearchEngines.js
testing/mozmill/tests/firefox/testSearch/testOpenSearchAutodiscovery.js
testing/mozmill/tests/firefox/testSearch/testRemoveSearchEngine.js
testing/mozmill/tests/firefox/testSearch/testReorderSearchEngines.js
testing/mozmill/tests/firefox/testSearch/testRestoreDefaults.js
testing/mozmill/tests/firefox/testSearch/testSearchSelection.js
testing/mozmill/tests/firefox/testSearch/testSearchSuggestions.js
testing/mozmill/tests/firefox/testSecurity/testBlueLarry.js
testing/mozmill/tests/firefox/testSecurity/testDefaultPhishingEnabled.js
testing/mozmill/tests/firefox/testSecurity/testDefaultSecurityPrefs.js
testing/mozmill/tests/firefox/testSecurity/testEncryptedPageWarning.js
testing/mozmill/tests/firefox/testSecurity/testGreenLarry.js
testing/mozmill/tests/firefox/testSecurity/testGreyLarry.js
testing/mozmill/tests/firefox/testSecurity/testIdentityPopupOpenClose.js
testing/mozmill/tests/firefox/testSecurity/testSSLDisabledErrorPage.js
testing/mozmill/tests/firefox/testSecurity/testSafeBrowsingNotificationBar.js
testing/mozmill/tests/firefox/testSecurity/testSafeBrowsingWarningPages.js
testing/mozmill/tests/firefox/testSecurity/testSecurityInfoViaPadlock.js
testing/mozmill/tests/firefox/testSecurity/testSecurityNotification.js
testing/mozmill/tests/firefox/testSecurity/testStatusBarSSLDisplay.js
testing/mozmill/tests/firefox/testSecurity/testSubmitUnencryptedInfoWarning.js
testing/mozmill/tests/firefox/testSecurity/testUnknownIssuer.js
testing/mozmill/tests/firefox/testSecurity/testUntrustedConnectionErrorPage.js
testing/mozmill/tests/firefox/testTabbedBrowsing/files/openinnewtab.html
testing/mozmill/tests/firefox/testTabbedBrowsing/files/openinnewtab_target.html
testing/mozmill/tests/firefox/testTabbedBrowsing/testBackgroundTabScrolling.js
testing/mozmill/tests/firefox/testTabbedBrowsing/testCloseTab.js
testing/mozmill/tests/firefox/testTabbedBrowsing/testNewTab.js
testing/mozmill/tests/firefox/testTabbedBrowsing/testNewWindow.js
testing/mozmill/tests/firefox/testTabbedBrowsing/testOpenInBackground.js
testing/mozmill/tests/firefox/testTabbedBrowsing/testOpenInForeground.js
testing/mozmill/tests/readme.txt
testing/mozmill/tests/scripts/libs/install.py
testing/mozmill/tests/scripts/libs/prefs.py
testing/mozmill/tests/scripts/readme.txt
testing/mozmill/tests/scripts/update.py
testing/mozmill/tests/templates/readme.txt
testing/mozmill/tests/templates/testEmptyTest.js
testing/mozmill/tests/templates/testModalDialog.js
testing/mozmill/tests/templates/testPreferencesDialog.js
testing/mozmill/tests/templates/testSharedModules.js
toolkit/crashreporter/google-breakpad/src/common/linux/memory.h
toolkit/mozapps/extensions/test/browser/browser_backgroundupdate_menuitem.js
--- a/Makefile.in
+++ b/Makefile.in
@@ -143,17 +143,17 @@ MAKE_SYM_STORE_ARGS += --vcs-info
 endif
 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
 # PDB files don't get moved to dist, so we need to scan the whole objdir
 MAKE_SYM_STORE_PATH := .
 endif
 ifeq ($(OS_ARCH),Darwin)
 # need to pass arch flags for universal builds
 ifdef UNIVERSAL_BINARY
-MAKE_SYM_STORE_ARGS := -c -a "ppc i386" --vcs-info
+MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
 MAKE_SYM_STORE_PATH := $(DIST)/universal
 else
 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
 MAKE_SYM_STORE_PATH := $(DIST)/bin
 endif
 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
 endif
 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
--- a/accessible/public/nsIAccessibilityService.h
+++ b/accessible/public/nsIAccessibilityService.h
@@ -70,16 +70,27 @@ public:
    * @param  aNode      [in] the DOM node to get an accessible for
    * @param  aPresShell [in] the presentation shell which contains layout info
    *                         for the DOM node
    */
   virtual nsAccessible* GetAccessibleInShell(nsINode* aNode,
                                              nsIPresShell* aPresShell) = 0;
 
   /**
+   * Return root document accessible that is or contains a document accessible
+   * for the given presshell.
+   *
+   * @param aPresShell  [in] the presshell
+   * @param aCanCreate  [in] points whether the root document accessible
+   *                        should be returned from the cache or can be created
+   */
+  virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
+                                                  PRBool aCanCreate) = 0;
+
+  /**
    * Creates accessible for the given DOM node or frame.
    */
   virtual already_AddRefed<nsAccessible>
     CreateHTMLBRAccessible(nsIContent* aContent, nsIPresShell* aPresShell) = 0;
   virtual already_AddRefed<nsAccessible>
     CreateHTML4ButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell) = 0;
   virtual already_AddRefed<nsAccessible>
     CreateHTMLButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell) = 0;
@@ -165,18 +176,17 @@ public:
   virtual void PresShellDestroyed(nsIPresShell *aPresShell) = 0;
 
   /**
    * Fire accessible event of the given type for the given target.
    *
    * @param aEvent   [in] accessible event type
    * @param aTarget  [in] target of accessible event
    */
-  virtual nsresult FireAccessibleEvent(PRUint32 aEvent,
-                                       nsIAccessible *aTarget) = 0;
+  virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,
                               NS_IACCESSIBILITYSERVICE_IID)
 
 // for component registration
 // {DE401C37-9A7F-4278-A6F8-3DE2833989EF}
 #define NS_ACCESSIBILITY_SERVICE_CID \
--- a/accessible/src/base/nsAccessibilityAtomList.h
+++ b/accessible/src/base/nsAccessibilityAtomList.h
@@ -133,16 +133,17 @@ ACCESSIBILITY_ATOM(listhead, "listhead")
 ACCESSIBILITY_ATOM(listheader, "listheader") // XUL
 ACCESSIBILITY_ATOM(map, "map")
 ACCESSIBILITY_ATOM(math, "math")
 ACCESSIBILITY_ATOM(menupopup, "menupopup")     // XUL
 ACCESSIBILITY_ATOM(object, "object")
 ACCESSIBILITY_ATOM(ol, "ol")
 ACCESSIBILITY_ATOM(optgroup, "optgroup")
 ACCESSIBILITY_ATOM(option, "option")
+ACCESSIBILITY_ATOM(output, "output")
 ACCESSIBILITY_ATOM(panel, "panel") // XUL
 ACCESSIBILITY_ATOM(q, "q")
 ACCESSIBILITY_ATOM(select, "select")
 ACCESSIBILITY_ATOM(select1, "select1") // XForms
 ACCESSIBILITY_ATOM(svg, "svg")
 ACCESSIBILITY_ATOM(table, "table")
 ACCESSIBILITY_ATOM(tabpanels, "tabpanels") // XUL
 ACCESSIBILITY_ATOM(tbody, "tbody")
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -160,28 +160,51 @@ nsAccessibilityService::NotifyOfAnchorJu
   // XXX note in rare cases the node could go away before we flush the queue,
   // for example if the node becomes inaccessible, or is removed from the DOM.
   GetDocAccessible(document)->
     FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_SCROLLING_START,
                                targetNode);
 }
 
 // nsIAccessibilityService
-nsresult
+void
 nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
-                                            nsIAccessible *aTarget)
+                                            nsAccessible* aTarget)
 {
-  nsRefPtr<nsAccessible> accessible(do_QueryObject(aTarget));
-  nsEventShell::FireEvent(aEvent, accessible);
-  return NS_OK;
+  nsEventShell::FireEvent(aEvent, aTarget);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibilityService
 
+nsAccessible*
+nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
+                                                  PRBool aCanCreate)
+{
+  nsIDocument* documentNode = aPresShell->GetDocument();
+  if (documentNode) {
+    nsCOMPtr<nsISupports> container = documentNode->GetContainer();
+    nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
+    if (treeItem) {
+      nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
+      treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
+      if (treeItem != rootTreeItem) {
+        nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(rootTreeItem));
+        nsCOMPtr<nsIPresShell> presShell;
+        docShell->GetPresShell(getter_AddRefs(presShell));
+        documentNode = presShell->GetDocument();
+      }
+
+      return aCanCreate ?
+        GetDocAccessible(documentNode) : GetDocAccessibleFromCache(documentNode);
+    }
+  }
+  return nsnull;
+}
+
 already_AddRefed<nsAccessible>
 nsAccessibilityService::CreateOuterDocAccessible(nsIContent* aContent,
                                                  nsIPresShell* aPresShell)
 {
   nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
   nsAccessible* accessible = new nsOuterDocAccessible(aContent, weakShell);
   NS_IF_ADDREF(accessible);
   return accessible;
@@ -1643,16 +1666,22 @@ nsAccessibilityService::CreateHTMLAccess
 
   if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
     nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
                                                                        aWeakShell);
     NS_IF_ADDREF(accessible);
     return accessible;
   }
 
+  if (tag == nsAccessibilityAtoms::output) {
+    nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aWeakShell);
+    NS_IF_ADDREF(accessible);
+    return accessible;
+  }
+
   return nsnull;
  }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibilityService (DON'T put methods here)
 
 nsAccessible*
 nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible)
--- a/accessible/src/base/nsAccessibilityService.h
+++ b/accessible/src/base/nsAccessibilityService.h
@@ -55,16 +55,18 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIACCESSIBLERETRIEVAL
   NS_DECL_NSIOBSERVER
 
   // nsIAccessibilityService
   virtual nsAccessible* GetAccessibleInShell(nsINode* aNode,
                                              nsIPresShell* aPresShell);
+  virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
+                                                  PRBool aCanCreate);
 
   virtual already_AddRefed<nsAccessible>
     CreateHTMLBRAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
   virtual already_AddRefed<nsAccessible>
     CreateHTML4ButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
   virtual already_AddRefed<nsAccessible>
     CreateHTMLButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
   virtual already_AddRefed<nsAccessible>
@@ -112,17 +114,17 @@ public:
   virtual nsresult InvalidateSubtreeFor(nsIPresShell *aPresShell,
                                         nsIContent *aContent,
                                         PRUint32 aChangeType);
 
   virtual void NotifyOfAnchorJumpTo(nsIContent *aTarget);
 
   virtual void PresShellDestroyed(nsIPresShell* aPresShell);
 
-  virtual nsresult FireAccessibleEvent(PRUint32 aEvent, nsIAccessible *aTarget);
+  virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget);
 
   // nsAccessibiltiyService
 
   /**
    * Return true if accessibility service has been shutdown.
    */
   static PRBool IsShutdown() { return gIsShutdown; }
 
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -2153,19 +2153,28 @@ nsAccessible::GetRelationByType(PRUint32
     {
       return nsRelUtils::
         AddTargetFromNeighbour(aRelationType, aRelation, mContent,
                                nsAccessibilityAtoms::aria_controls);
     }
 
   case nsIAccessibleRelation::RELATION_CONTROLLER_FOR:
     {
-      return nsRelUtils::
+      nsresult rv = nsRelUtils::
         AddTargetFromIDRefsAttr(aRelationType, aRelation, mContent,
                                 nsAccessibilityAtoms::aria_controls);
+      NS_ENSURE_SUCCESS(rv,rv);
+
+      if (rv != NS_OK_NO_RELATION_TARGET)
+        return NS_OK; // XXX bug 381599, avoid performance problems      
+
+      return nsRelUtils::
+        AddTargetFromNeighbour(aRelationType, aRelation, mContent,
+                               nsAccessibilityAtoms::_for,
+                               nsAccessibilityAtoms::output);
     }
 
   case nsIAccessibleRelation::RELATION_FLOWS_TO:
     {
       return nsRelUtils::
         AddTargetFromIDRefsAttr(aRelationType, aRelation, mContent,
                                 nsAccessibilityAtoms::aria_flowto);
     }
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -88,37 +88,26 @@ nsIAtom *nsDocAccessible::gLastFocusedFr
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/desctructor
 
 nsDocAccessible::
   nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
                   nsIWeakReference *aShell) :
-  nsHyperTextAccessibleWrap(aRootContent, aShell), mWnd(nsnull),
+  nsHyperTextAccessibleWrap(aRootContent, aShell),
   mDocument(aDocument), mScrollPositionChangedTicks(0), mIsLoaded(PR_FALSE)
 {
   // XXX aaronl should we use an algorithm for the initial cache size?
   mAccessibleCache.Init(kDefaultCacheSize);
 
   // For GTK+ native window, we do nothing here.
   if (!mDocument)
     return;
 
-  // Initialize mWnd
-  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
-  nsIViewManager* vm = shell->GetViewManager();
-  if (vm) {
-    nsCOMPtr<nsIWidget> widget;
-    vm->GetRootWidget(getter_AddRefs(widget));
-    if (widget) {
-      mWnd = widget->GetNativeData(NS_NATIVE_WINDOW);
-    }
-  }
-
   // nsAccDocManager creates document accessible when scrollable frame is
   // available already, it should be safe time to add scroll listener.
   AddScrollListener();
 }
 
 nsDocAccessible::~nsDocAccessible()
 {
 }
@@ -468,17 +457,18 @@ NS_IMETHODIMP nsDocAccessible::GetNameSp
     if (nameSpaceManager)
       return nameSpaceManager->GetNameSpaceURI(aNameSpaceID, aNameSpaceURI);
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP nsDocAccessible::GetWindowHandle(void **aWindow)
 {
-  *aWindow = mWnd;
+  NS_ENSURE_ARG_POINTER(aWindow);
+  *aWindow = GetNativeWindow();
   return NS_OK;
 }
 
 NS_IMETHODIMP nsDocAccessible::GetWindow(nsIDOMWindow **aDOMWin)
 {
   *aDOMWin = nsnull;
   if (!mDocument) {
     return NS_ERROR_FAILURE;  // Accessible is Shutdown()
@@ -1330,16 +1320,30 @@ nsDocAccessible::HandleAccEvent(AccEvent
   return nsHyperTextAccessible::HandleAccEvent(aAccEvent);
 
 }
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////
 // Public members
 
+void*
+nsDocAccessible::GetNativeWindow() const
+{
+  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
+  nsIViewManager* vm = shell->GetViewManager();
+  if (vm) {
+    nsCOMPtr<nsIWidget> widget;
+    vm->GetRootWidget(getter_AddRefs(widget));
+    if (widget)
+      return widget->GetNativeData(NS_NATIVE_WINDOW);
+  }
+  return nsnull;
+}
+
 nsAccessible*
 nsDocAccessible::GetCachedAccessibleInSubtree(void* aUniqueID)
 {
   nsAccessible* child = GetCachedAccessible(aUniqueID);
   if (child)
     return child;
 
   PRUint32 childDocCount = mChildDocuments.Length();
--- a/accessible/src/base/nsDocAccessible.h
+++ b/accessible/src/base/nsDocAccessible.h
@@ -137,16 +137,21 @@ public:
   /**
    * Marks as loaded, used for error pages as workaround since they do not
    * receive pageshow event and as consequence nsIDocument::IsShowing() returns
    * false.
    */
   void MarkAsLoaded() { mIsLoaded = PR_TRUE; }
 
   /**
+   * Return a native window handler or pointer depending on platform.
+   */
+  virtual void* GetNativeWindow() const;
+
+  /**
    * Return the parent document.
    */
   nsDocAccessible* ParentDocument() const
     { return mParent ? mParent->GetDocAccessible() : nsnull; }
 
   /**
    * Return the child document count.
    */
@@ -358,17 +363,16 @@ protected:
    */
   void FireValueChangeForTextFields(nsAccessible *aAccessible);
 
   /**
    * Cache of accessibles within this document accessible.
    */
   nsAccessibleHashtable mAccessibleCache;
 
-    void *mWnd;
     nsCOMPtr<nsIDocument> mDocument;
     nsCOMPtr<nsITimer> mScrollWatchTimer;
     PRUint16 mScrollPositionChangedTicks; // Used for tracking scroll events
 
 protected:
 
   nsRefPtr<nsAccEventQueue> mEventQueue;
 
--- a/accessible/src/html/nsHTMLTextAccessible.cpp
+++ b/accessible/src/html/nsHTMLTextAccessible.cpp
@@ -35,16 +35,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsHTMLTextAccessible.h"
 
 #include "nsDocAccessible.h"
+#include "nsAccUtils.h"
+#include "nsRelUtils.h"
 #include "nsTextEquivUtils.h"
 
 #include "nsIFrame.h"
 #include "nsPresContext.h"
 #include "nsISelection.h"
 #include "nsISelectionController.h"
 #include "nsComponentManagerUtils.h"
 
@@ -191,16 +193,66 @@ nsHTMLLabelAccessible::GetNameInternal(n
 
 PRUint32
 nsHTMLLabelAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_LABEL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+// nsHTMLOuputAccessible
+////////////////////////////////////////////////////////////////////////////////
+
+nsHTMLOutputAccessible::
+  nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
+  nsHyperTextAccessibleWrap(aContent, aShell)
+{
+}
+
+NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLOutputAccessible, nsHyperTextAccessible)
+
+NS_IMETHODIMP
+nsHTMLOutputAccessible::GetRelationByType(PRUint32 aRelationType,
+                                          nsIAccessibleRelation** aRelation)
+{
+  nsresult rv = nsAccessibleWrap::GetRelationByType(aRelationType, aRelation);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (rv != NS_OK_NO_RELATION_TARGET)
+    return NS_OK; // XXX bug 381599, avoid performance problems
+
+  if (aRelationType == nsIAccessibleRelation::RELATION_CONTROLLED_BY) {
+    return nsRelUtils::
+      AddTargetFromIDRefsAttr(aRelationType, aRelation, mContent,
+                              nsAccessibilityAtoms::_for);
+  }
+
+  return NS_OK;
+}
+
+PRUint32
+nsHTMLOutputAccessible::NativeRole()
+{
+  return nsIAccessibleRole::ROLE_SECTION;
+}
+
+nsresult
+nsHTMLOutputAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
+{
+  nsresult rv = nsAccessibleWrap::GetAttributesInternal(aAttributes);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::live,
+                         NS_LITERAL_STRING("polite"));
+  
+  return NS_OK;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
 // nsHTMLLIAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsHTMLLIAccessible::
   nsHTMLLIAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                      const nsAString& aBulletText) :
   nsHyperTextAccessibleWrap(aContent, aShell)
 {
--- a/accessible/src/html/nsHTMLTextAccessible.h
+++ b/accessible/src/html/nsHTMLTextAccessible.h
@@ -101,16 +101,35 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsAccessible
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual PRUint32 NativeRole();
 };
 
 /**
+ * Used for HTML output element.
+ */
+class nsHTMLOutputAccessible : public nsHyperTextAccessibleWrap
+{
+public:
+  nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
+
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIAccessible
+  NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
+                               nsIAccessibleRelation** aRelation);
+
+  // nsAccessible
+  virtual PRUint32 NativeRole();
+  virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
+};
+
+/**
  * Used for bullet of HTML list item element (for example, HTML li).
  */
 class nsHTMLListBulletAccessible : public nsLeafAccessible
 {
 public:
   nsHTMLListBulletAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                              const nsAString& aBulletText);
 
--- a/accessible/src/mac/mozAccessible.mm
+++ b/accessible/src/mac/mozAccessible.mm
@@ -589,19 +589,23 @@ GetNativeFromGeckoAccessible(nsIAccessib
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (NSWindow*)window
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   nsAccessibleWrap *accWrap = static_cast<nsAccessibleWrap*>(mGeckoAccessible);
+
+  // Get a pointer to the native window (NSWindow) we reside in.
   NSWindow *nativeWindow = nil;
-  accWrap->GetNativeWindow ((void**)&nativeWindow);
-  
+  nsDocAccessible* docAcc = accWrap->GetDocAccessible();
+  if (docAcc)
+    nativeWindow = static_cast<NSWindow*>(docAcc->GetNativeWindow());
+
   NSAssert1(nativeWindow, @"Could not get native window for %@", self);
   return nativeWindow;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (void)invalidateChildren
 {
--- a/accessible/src/mac/nsAccessibleWrap.h
+++ b/accessible/src/mac/nsAccessibleWrap.h
@@ -66,20 +66,17 @@ class nsAccessibleWrap : public nsAccess
     
     // get the native obj-c object (mozAccessible)
     NS_IMETHOD GetNativeInterface (void **aOutAccessible);
     
     // the objective-c |Class| type that this accessible's native object
     // should be instantied with.   used on runtime to determine the
     // right type for this accessible's associated native object.
     virtual objc_class* GetNativeType ();
-    
-    // returns a pointer to the native window for this accessible tree.
-    void GetNativeWindow (void **aOutNativeWindow);
-    
+
     virtual void Shutdown ();
     virtual void InvalidateChildren();
 
     virtual nsresult HandleAccEvent(AccEvent* aEvent);
 
     // ignored means that the accessible might still have children, but is not displayed
     // to the user. it also has no native accessible object represented for it.
     PRBool IsIgnored();
--- a/accessible/src/mac/nsAccessibleWrap.mm
+++ b/accessible/src/mac/nsAccessibleWrap.mm
@@ -81,27 +81,16 @@ nsAccessibleWrap::GetNativeInterface (vo
 {
   if (mNativeWrapper) {
     *aOutInterface = (void**)mNativeWrapper->getNativeObject();
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
-// get the native NSWindow we reside in.
-void
-nsAccessibleWrap::GetNativeWindow (void **aOutNativeWindow)
-{
-  *aOutNativeWindow = nsnull;
-
-  nsDocAccessible *docAcc = GetDocAccessible();
-  if (docAcc)
-    docAcc->GetWindowHandle (aOutNativeWindow);
-}
-
 // overridden in subclasses to create the right kind of object. by default we create a generic
 // 'mozAccessible' node.
 objc_class*
 nsAccessibleWrap::GetNativeType () 
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   PRUint32 role = Role();
--- a/accessible/src/msaa/nsAccessNodeWrap.cpp
+++ b/accessible/src/msaa/nsAccessNodeWrap.cpp
@@ -41,16 +41,17 @@
 #include "AccessibleApplication.h"
 #include "ISimpleDOMNode_i.c"
 
 #include "nsAccessibilityAtoms.h"
 #include "nsAccessibilityService.h"
 #include "nsApplicationAccessibleWrap.h"
 #include "nsCoreUtils.h"
 #include "nsRootAccessible.h"
+#include "nsWinUtils.h"
 
 #include "nsAttrName.h"
 #include "nsIDocument.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMViewCSS.h"
 #include "nsIFrame.h"
 #include "nsINameSpaceManager.h"
@@ -58,16 +59,17 @@
 #include "nsIPrefBranch.h"
 #include "nsPIDOMWindow.h"
 #include "nsIServiceManager.h"
 
 /// the accessible library and cached methods
 HINSTANCE nsAccessNodeWrap::gmAccLib = nsnull;
 HINSTANCE nsAccessNodeWrap::gmUserLib = nsnull;
 LPFNACCESSIBLEOBJECTFROMWINDOW nsAccessNodeWrap::gmAccessibleObjectFromWindow = nsnull;
+LPFNLRESULTFROMOBJECT nsAccessNodeWrap::gmLresultFromObject = NULL;
 LPFNNOTIFYWINEVENT nsAccessNodeWrap::gmNotifyWinEvent = nsnull;
 LPFNGETGUITHREADINFO nsAccessNodeWrap::gmGetGUIThreadInfo = nsnull;
 
 PRBool nsAccessNodeWrap::gIsEnumVariantSupportDisabled = 0;
 // Used to determine whether an IAccessible2 compatible screen reader is loaded.
 PRBool nsAccessNodeWrap::gIsIA2Disabled = PR_FALSE;
 
 AccTextChangeEvent* nsAccessNodeWrap::gTextEvent = nsnull;
@@ -127,23 +129,69 @@ STDMETHODIMP nsAccessNodeWrap::QueryInte
    
   (reinterpret_cast<IUnknown*>(*ppv))->AddRef(); 
   return S_OK;
 }
 
 STDMETHODIMP
 nsAccessNodeWrap::QueryService(REFGUID guidService, REFIID iid, void** ppv)
 {
+  *ppv = nsnull;
+
   static const GUID IID_SimpleDOMDeprecated = {0x0c539790,0x12e4,0x11cf,0xb6,0x61,0x00,0xaa,0x00,0x4c,0xd6,0xd8};
+
+  // Provide a special service ID for getting the accessible for the browser tab
+  // document that contains this accessible object. If this accessible object
+  // is not inside a browser tab then the service fails with E_NOINTERFACE.
+  // A use case for this is for screen readers that need to switch context or
+  // 'virtual buffer' when focus moves from one browser tab area to another.
+  static const GUID SID_IAccessibleContentDocument = {0xa5d8e1f3,0x3571,0x4d8f,0x95,0x21,0x07,0xed,0x28,0xfb,0x07,0x2e};
+
   if (guidService != IID_ISimpleDOMNode &&
       guidService != IID_SimpleDOMDeprecated &&
       guidService != IID_IAccessible &&  guidService != IID_IAccessible2 &&
-      guidService != IID_IAccessibleApplication)
+      guidService != IID_IAccessibleApplication &&
+      guidService != SID_IAccessibleContentDocument)
     return E_INVALIDARG;
 
+  if (guidService == SID_IAccessibleContentDocument) {
+    if (iid != IID_IAccessible)
+      return E_NOINTERFACE;
+
+    nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = 
+      nsCoreUtils::GetDocShellTreeItemFor(mContent);
+    if (!docShellTreeItem)
+      return E_UNEXPECTED;
+
+    // Walk up the parent chain without crossing the boundary at which item
+    // types change, preventing us from walking up out of tab content.
+    nsCOMPtr<nsIDocShellTreeItem> root;
+    docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(root));
+    if (!root)
+      return E_UNEXPECTED;
+
+
+    // If the item type is typeContent, we assume we are in browser tab content.
+    // Note this includes content such as about:addons, for consistency.
+    PRInt32 itemType;
+    root->GetItemType(&itemType);
+    if (itemType != nsIDocShellTreeItem::typeContent)
+      return E_NOINTERFACE;
+
+    // Make sure this is a document.
+    nsDocAccessible* docAcc = nsAccUtils::GetDocAccessibleFor(root);
+    if (!docAcc)
+      return E_UNEXPECTED;
+
+    *ppv = static_cast<IAccessible*>(docAcc);
+
+    (reinterpret_cast<IUnknown*>(*ppv))->AddRef();
+    return NS_OK;
+  }
+
   // Can get to IAccessibleApplication from any node via QS
   if (iid == IID_IAccessibleApplication) {
     nsApplicationAccessible *applicationAcc = GetApplicationAccessible();
     if (!applicationAcc)
       return E_NOINTERFACE;
 
     nsresult rv = applicationAcc->QueryNativeInterface(iid, ppv);
     return NS_SUCCEEDED(rv) ? S_OK : E_NOINTERFACE;
@@ -564,25 +612,37 @@ void nsAccessNodeWrap::InitAccessibility
   if (gmUserLib) {
     if (!gmNotifyWinEvent)
       gmNotifyWinEvent = (LPFNNOTIFYWINEVENT)GetProcAddress(gmUserLib,"NotifyWinEvent");
     if (!gmGetGUIThreadInfo)
       gmGetGUIThreadInfo = (LPFNGETGUITHREADINFO)GetProcAddress(gmUserLib,"GetGUIThreadInfo");
   }
 
   DoATSpecificProcessing();
-  
+
+  // Register window class that'll be used for document accessibles associated
+  // with tabs.
+  if (nsWinUtils::IsWindowEmulationEnabled()) {
+    nsWinUtils::RegisterNativeWindow(kClassNameTabContent);
+    sHWNDCache.Init(4);
+  }
+
   nsAccessNode::InitXPAccessibility();
 }
 
 void nsAccessNodeWrap::ShutdownAccessibility()
 {
   NS_IF_RELEASE(gTextEvent);
   ::DestroyCaret();
 
+  // Unregister window call that's used for document accessibles associated
+  // with tabs.
+  if (nsWinUtils::IsWindowEmulationEnabled())
+    ::UnregisterClassW(kClassNameTabContent, GetModuleHandle(NULL));
+
   nsAccessNode::ShutdownXPAccessibility();
 }
 
 int nsAccessNodeWrap::FilterA11yExceptions(unsigned int aCode, EXCEPTION_POINTERS *aExceptionInfo)
 {
   if (aCode == EXCEPTION_ACCESS_VIOLATION) {
 #ifdef MOZ_CRASHREPORTER
     // MSAA swallows crashes (because it is COM-based)
@@ -619,17 +679,17 @@ GetHRESULT(nsresult aResult)
 
     default:
       return E_FAIL;
   }
 }
 
 PRBool nsAccessNodeWrap::IsOnlyMsaaCompatibleJawsPresent()
 {
-  HMODULE jhookhandle = ::GetModuleHandleW(L"jhook");
+  HMODULE jhookhandle = ::GetModuleHandleW(kJAWSModuleHandle);
   if (!jhookhandle)
     return PR_FALSE;  // No JAWS, or some other screen reader, use IA2
 
   PRUnichar fileName[MAX_PATH];
   ::GetModuleFileNameW(jhookhandle, fileName, MAX_PATH);
 
   DWORD dummy;
   DWORD length = ::GetFileVersionInfoSizeW(fileName, &dummy);
@@ -650,20 +710,20 @@ PRBool nsAccessNodeWrap::IsOnlyMsaaCompa
 //  DWORD dwRightMost = LOWORD(dwFileVersionLS);
 
   return (dwLeftMost < 8
           || (dwLeftMost == 8 && dwSecondRight < 2173));
 }
 
 void nsAccessNodeWrap::TurnOffNewTabSwitchingForJawsAndWE()
 {
-  HMODULE srHandle = ::GetModuleHandleW(L"jhook");
+  HMODULE srHandle = ::GetModuleHandleW(kJAWSModuleHandle);
   if (!srHandle) {
     // No JAWS, try Window-Eyes
-    srHandle = ::GetModuleHandleW(L"gwm32inc");
+    srHandle = ::GetModuleHandleW(kWEModuleHandle);
     if (!srHandle) {
       // no screen reader we're interested in. Bail out.
       return;
     }
   }
 
   // Check to see if the pref for disallowing CtrlTab is already set.
   // If so, bail out.
@@ -689,8 +749,54 @@ void nsAccessNodeWrap::TurnOffNewTabSwit
 void nsAccessNodeWrap::DoATSpecificProcessing()
 {
   if (IsOnlyMsaaCompatibleJawsPresent())
     // All versions below 8.0.2173 are not compatible
     gIsIA2Disabled  = PR_TRUE;
 
   TurnOffNewTabSwitchingForJawsAndWE();
 }
+
+nsRefPtrHashtable<nsVoidPtrHashKey, nsDocAccessible> nsAccessNodeWrap::sHWNDCache;
+
+LRESULT CALLBACK
+nsAccessNodeWrap::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+  switch (msg) {
+    case WM_GETOBJECT:
+    {
+      if (lParam == OBJID_CLIENT) {
+        nsDocAccessible* document = sHWNDCache.GetWeak(static_cast<void*>(hWnd));
+        if (document) {
+          IAccessible* msaaAccessible = NULL;
+          document->GetNativeInterface((void**)&msaaAccessible); // does an addref
+          if (msaaAccessible) {
+            LRESULT result = LresultFromObject(IID_IAccessible, wParam,
+                                               msaaAccessible); // does an addref
+            msaaAccessible->Release(); // release extra addref
+            return result;
+          }
+        }
+      }
+      return 0;
+    }
+  }
+
+  return ::DefWindowProcW(hWnd, msg, wParam, lParam);
+}
+
+STDMETHODIMP_(LRESULT)
+nsAccessNodeWrap::LresultFromObject(REFIID riid, WPARAM wParam, LPUNKNOWN pAcc)
+{
+  // open the dll dynamically
+  if (!gmAccLib)
+    gmAccLib =::LoadLibraryW(L"OLEACC.DLL");
+
+  if (gmAccLib) {
+    if (!gmLresultFromObject)
+      gmLresultFromObject = (LPFNLRESULTFROMOBJECT)GetProcAddress(gmAccLib,"LresultFromObject");
+
+    if (gmLresultFromObject)
+      return gmLresultFromObject(riid, wParam, pAcc);
+  }
+
+  return 0;
+}
--- a/accessible/src/msaa/nsAccessNodeWrap.h
+++ b/accessible/src/msaa/nsAccessNodeWrap.h
@@ -63,16 +63,18 @@
 #include <winuser.h>
 #ifndef WINABLEAPI
 #include <winable.h>
 #endif
 #ifdef MOZ_CRASHREPORTER
 #include "nsICrashReporter.h"
 #endif
 
+#include "nsRefPtrHashtable.h"
+
 typedef LRESULT (STDAPICALLTYPE *LPFNNOTIFYWINEVENT)(DWORD event,HWND hwnd,LONG idObjectType,LONG idObject);
 typedef LRESULT (STDAPICALLTYPE *LPFNGETGUITHREADINFO)(DWORD idThread, GUITHREADINFO* pgui);
 
 class AccTextChangeEvent;
 
 class nsAccessNodeWrap :  public nsAccessNode,
                           public nsIWinAccessNode,
                           public ISimpleDOMNode,
@@ -149,27 +151,35 @@ public: // construction, destruction
 
     static void InitAccessibility();
     static void ShutdownAccessibility();
 
     /// the accessible library and cached methods
     static HINSTANCE gmAccLib;
     static HINSTANCE gmUserLib;
     static LPFNACCESSIBLEOBJECTFROMWINDOW gmAccessibleObjectFromWindow;
+    static LPFNLRESULTFROMOBJECT gmLresultFromObject;
     static LPFNNOTIFYWINEVENT gmNotifyWinEvent;
     static LPFNGETGUITHREADINFO gmGetGUIThreadInfo;
 
     static int FilterA11yExceptions(unsigned int aCode, EXCEPTION_POINTERS *aExceptionInfo);
 
     static PRBool IsOnlyMsaaCompatibleJawsPresent();
 
     static void TurnOffNewTabSwitchingForJawsAndWE();
 
     static void DoATSpecificProcessing();
 
+  static STDMETHODIMP_(LRESULT) LresultFromObject(REFIID riid, WPARAM wParam, LPUNKNOWN pAcc);
+
+  static LRESULT CALLBACK WindowProc(HWND hWnd, UINT Msg,
+                                     WPARAM WParam, LPARAM lParam);
+
+  static nsRefPtrHashtable<nsVoidPtrHashKey, nsDocAccessible> sHWNDCache;
+
 protected:
 
   /**
    * Return ISimpleDOMNode instance for existing accessible object or
    * creates new nsAccessNode instance if the accessible doesn't exist.
    *
    * @note ISimpleDOMNode is returned addrefed
    */
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -37,16 +37,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsAccessibleWrap.h"
 
 #include "nsAccessibilityAtoms.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsRelUtils.h"
+#include "nsWinUtils.h"
 
 #include "nsIAccessibleDocument.h"
 #include "nsIAccessibleEvent.h"
 #include "nsIAccessibleWin32Object.h"
 
 #include "Accessible2_i.c"
 #include "AccessibleStates.h"
 
@@ -188,68 +189,33 @@ STDMETHODIMP nsAccessibleWrap::NotifyWin
 
   return E_FAIL;
 }
 
 STDMETHODIMP nsAccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
 {
 __try {
   *ppdispParent = NULL;
-  if (!mWeakShell)
-    return E_FAIL;  // We've been shut down
 
-  nsIFrame *frame = GetFrame();
-  HWND hwnd = 0;
-  if (frame) {
-    nsIView *view = frame->GetViewExternal();
-    if (view) {
-      // This code is essentially our implementation of WindowFromAccessibleObject,
-      // because MSAA iterates get_accParent() until it sees an object of ROLE_WINDOW
-      // to know where the window for a given accessible is. We must expose the native
-      // window accessible that MSAA creates for us. This must be done for the document
-      // object as well as any layout that creates its own window (e.g. via overflow: scroll)
-      nsIWidget *widget = view->GetWidget();
-      if (widget) {
-        hwnd = (HWND)widget->GetNativeData(NS_NATIVE_WINDOW);
-        NS_ASSERTION(hwnd, "No window handle for window");
-
-        nsIViewManager* viewManager = view->GetViewManager();
-        if (!viewManager)
-          return E_UNEXPECTED;
+  if (IsDefunct())
+    return E_FAIL;
 
-        nsIView *rootView;
-        viewManager->GetRootView(rootView);
-        if (rootView == view) {
-          // If the client accessible (OBJID_CLIENT) has a window but its window
-          // was created by an outer window then we want the native accessible
-          // for that outer window. If the accessible was created for outer
-          // window (if the outer window has inner windows then they share the
-          // same client accessible with it) then return native accessible for
-          // the outer window.
-          HWND parenthwnd = ::GetParent(hwnd);
-          if (parenthwnd)
-            hwnd = parenthwnd;
-
-          NS_ASSERTION(hwnd, "No window handle for window");
-        }
+  nsRefPtr<nsDocAccessible> doc(do_QueryObject(this));
+  if (doc) {
+    // Return window system accessible object for root document and tab document
+    // accessibles.
+    if (!doc->ParentDocument() ||
+        nsWinUtils::IsWindowEmulationEnabled() &&
+        nsWinUtils::IsTabDocument(doc->GetDocumentNode())) {
+      HWND hwnd = static_cast<HWND>(doc->GetNativeWindow());
+      if (hwnd && SUCCEEDED(AccessibleObjectFromWindow(hwnd, OBJID_WINDOW,
+                                                       IID_IAccessible,
+                                                       (void**)ppdispParent))) {
+        return S_OK;
       }
-      else {
-        // If a frame is a scrollable frame, then it has one window for the client area,
-        // not an extra parent window for just the scrollbars
-        nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
-        if (scrollFrame) {
-          hwnd = (HWND)scrollFrame->GetScrolledFrame()->GetNearestWidget()->GetNativeData(NS_NATIVE_WINDOW);
-          NS_ASSERTION(hwnd, "No window handle for window");
-        }
-      }
-    }
-
-    if (hwnd && SUCCEEDED(AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, IID_IAccessible,
-                                              (void**)ppdispParent))) {
-      return S_OK;
     }
   }
 
   nsAccessible* xpParentAcc = GetParent();
   NS_ASSERTION(xpParentAcc,
                "No parent accessible where we're not direct child of window");
 
   if (!xpParentAcc)
@@ -382,16 +348,19 @@ nsAccessibleWrap::get_accDescription(VAR
 
 STDMETHODIMP nsAccessibleWrap::get_accRole(
       /* [optional][in] */ VARIANT varChild,
       /* [retval][out] */ VARIANT __RPC_FAR *pvarRole)
 {
 __try {
   VariantInit(pvarRole);
 
+  if (IsDefunct())
+    return E_FAIL;
+
   nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_FAIL;
 
 #ifdef DEBUG_A11Y
   NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(xpAccessible),
                "Does not support nsIAccessibleText when it should");
 #endif
@@ -1182,16 +1151,19 @@ nsAccessibleWrap::get_relations(long aMa
 }
 
 STDMETHODIMP
 nsAccessibleWrap::role(long *aRole)
 {
 __try {
   *aRole = 0;
 
+  if (IsDefunct())
+    return E_FAIL;
+
   NS_ASSERTION(gWindowsRoleMap[nsIAccessibleRole::ROLE_LAST_ENTRY].ia2Role == ROLE_WINDOWS_LAST_ENTRY,
                "MSAA role map skewed");
 
   PRUint32 xpRole = Role();
   *aRole = gWindowsRoleMap[xpRole].ia2Role;
 
   // Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call
   // the IA2 role a ROLE_OUTLINEITEM.
@@ -1657,55 +1629,21 @@ PRInt32 nsAccessibleWrap::GetChildIDFor(
   // Yes, this means we're only compatibible with 32 bit
   // MSAA is only available for 32 bit windows, so it's okay
   return - NS_PTR_TO_INT32(uniqueID);
 }
 
 HWND
 nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
 {
-  HWND hWnd = 0;
   if (!aAccessible)
-    return hWnd;
+    return 0;
 
-  nsIFrame *frame = aAccessible->GetFrame();
-  if (frame) {
-    nsIWidget *window = frame->GetNearestWidget();
-    PRBool isVisible;
-    window->IsVisible(isVisible);
-    if (isVisible) {
-      // Short explanation:
-      // If HWND for frame is inside a hidden window, fire the event on the
-      // containing document's visible window.
-      //
-      // Long explanation:
-      // This is really just to fix combo boxes with JAWS. Window-Eyes already
-      // worked with combo boxes because they use the value change event in
-      // the closed combo box case. JAWS will only pay attention to the focus
-      // events on the list items. The JAWS developers haven't fixed that, so
-      // we'll use the focus events to make JAWS work. However, JAWS is
-      // ignoring events on a hidden window. So, in order to fix the bug where
-      // JAWS doesn't echo the current option as it changes in a closed
-      // combo box, we need to use an ensure that we never fire an event with
-      // an HWND for a hidden window.
-      hWnd = (HWND)frame->GetNearestWidget()->GetNativeData(NS_NATIVE_WINDOW);
-    }
-  }
-
-  if (!hWnd) {
-    void* handle = nsnull;
-    nsDocAccessible *accessibleDoc = aAccessible->GetDocAccessible();
-    if (!accessibleDoc)
-      return 0;
-
-    accessibleDoc->GetWindowHandle(&handle);
-    hWnd = (HWND)handle;
-  }
-
-  return hWnd;
+  nsDocAccessible* document = aAccessible->GetDocAccessible();
+  return document ? static_cast<HWND>(document->GetNativeWindow()) : 0;
 }
 
 HRESULT
 nsAccessibleWrap::ConvertToIA2Attributes(nsIPersistentProperties *aAttributes,
                                          BSTR *aIA2Attributes)
 {
   *aIA2Attributes = NULL;
 
--- a/accessible/src/msaa/nsDocAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsDocAccessibleWrap.cpp
@@ -34,16 +34,19 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsDocAccessibleWrap.h"
 #include "ISimpleDOMDocument_i.c"
 #include "nsIAccessibilityService.h"
+#include "nsRootAccessible.h"
+#include "nsWinUtils.h"
+
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIFrame.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsISelectionController.h"
 #include "nsIServiceManager.h"
 #include "nsIURI.h"
 #include "nsIViewManager.h"
@@ -55,17 +58,17 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsDocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
 nsDocAccessibleWrap::
   nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                       nsIWeakReference *aShell) :
-  nsDocAccessible(aDocument, aRootContent, aShell)
+  nsDocAccessible(aDocument, aRootContent, aShell), mHWND(NULL)
 {
 }
 
 nsDocAccessibleWrap::~nsDocAccessibleWrap()
 {
 }
 
 //-----------------------------------------------------
@@ -240,8 +243,58 @@ STDMETHODIMP nsDocAccessibleWrap::get_ac
   if (role != nsIAccessibleRole::ROLE_DOCUMENT &&
       role != nsIAccessibleRole::ROLE_APPLICATION &&
       role != nsIAccessibleRole::ROLE_DIALOG &&
       role != nsIAccessibleRole::ROLE_ALERT)
     return hr;
 
   return get_URL(pszValue);
 }
+
+////////////////////////////////////////////////////////////////////////////////
+// nsAccessNode
+
+PRBool
+nsDocAccessibleWrap::Init()
+{
+  if (nsWinUtils::IsWindowEmulationEnabled()) {
+    // Create window for tab document.
+    if (nsWinUtils::IsTabDocument(mDocument)) {
+      nsRefPtr<nsRootAccessible> root = GetRootAccessible();
+      mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent,
+                                             static_cast<HWND>(root->GetNativeWindow()));
+
+      nsAccessibleWrap::sHWNDCache.Put(mHWND, this);
+
+    } else {
+      nsDocAccessible* parentDocument = ParentDocument();
+      if (parentDocument)
+        mHWND = parentDocument->GetNativeWindow();
+    }
+  }
+
+  return nsDocAccessible::Init();
+}
+
+void
+nsDocAccessibleWrap::Shutdown()
+{
+  if (nsWinUtils::IsWindowEmulationEnabled()) {
+    // Destroy window created for root document.
+    if (nsWinUtils::IsTabDocument(mDocument)) {
+      nsAccessibleWrap::sHWNDCache.Remove(mHWND);
+      ::DestroyWindow(static_cast<HWND>(mHWND));
+    }
+
+    mHWND = nsnull;
+  }
+
+  nsDocAccessible::Shutdown();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// nsDocAccessible
+
+void*
+nsDocAccessibleWrap::GetNativeWindow() const
+{
+  return mHWND ? mHWND : nsDocAccessible::GetNativeWindow();
+}
--- a/accessible/src/msaa/nsDocAccessibleWrap.h
+++ b/accessible/src/msaa/nsDocAccessibleWrap.h
@@ -84,13 +84,23 @@ public:
 
     // IAccessible
 
     // Override get_accValue to provide URL when no other value is available
     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue( 
         /* [optional][in] */ VARIANT varChild,
         /* [retval][out] */ BSTR __RPC_FAR *pszValue);
 
+  // nsAccessNode
+  virtual PRBool Init();
+  virtual void Shutdown();
+
   // nsAccessibleWrap
   virtual nsAccessible *GetXPAccessibleFor(const VARIANT& varChild);
+
+  // nsDocAccessible
+  virtual void* GetNativeWindow() const;
+
+protected:
+  void* mHWND;
 };
 
 #endif
--- a/accessible/src/msaa/nsWinUtils.cpp
+++ b/accessible/src/msaa/nsWinUtils.cpp
@@ -38,16 +38,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsWinUtils.h"
 
 #include "nsAccessibleWrap.h"
 #include "nsIWinAccessNode.h"
 #include "nsArrayUtils.h"
+#include "nsIDocShellTreeItem.h"
 
 HRESULT
 nsWinUtils::ConvertToIA2Array(nsIArray *aGeckoArray, IUnknown ***aIA2Array,
                               long *aIA2ArrayLen)
 {
   *aIA2Array = NULL;
   *aIA2ArrayLen = 0;
 
@@ -58,17 +59,17 @@ nsWinUtils::ConvertToIA2Array(nsIArray *
   nsresult rv = aGeckoArray->GetLength(&length);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);
 
   if (length == 0)
     return S_FALSE;
 
   *aIA2Array =
-    static_cast<IUnknown**>(nsMemory::Alloc((length) * sizeof(IUnknown*)));
+    static_cast<IUnknown**>(::CoTaskMemAlloc((length) * sizeof(IUnknown*)));
   if (!*aIA2Array)
     return E_OUTOFMEMORY;
 
   PRUint32 idx = 0;
   for (; idx < length; ++idx) {
     nsCOMPtr<nsIWinAccessNode> winAccessNode =
       do_QueryElementAt(aGeckoArray, idx, &rv);
     if (NS_FAILED(rv))
@@ -84,15 +85,69 @@ nsWinUtils::ConvertToIA2Array(nsIArray *
   }
 
   if (NS_FAILED(rv)) {
     for (PRUint32 idx2 = 0; idx2 < idx; idx2++) {
       (*aIA2Array)[idx2]->Release();
       (*aIA2Array)[idx2] = NULL;
     }
 
-    nsMemory::Free(*aIA2Array);
+    ::CoTaskMemFree(*aIA2Array);
     return GetHRESULT(rv);
   }
 
   *aIA2ArrayLen = length;
   return S_OK;
 }
+
+void
+nsWinUtils::RegisterNativeWindow(LPCWSTR aWindowClass)
+{
+  WNDCLASSW wc;
+  wc.style = CS_GLOBALCLASS;
+  wc.lpfnWndProc = nsAccessNodeWrap::WindowProc;
+  wc.cbClsExtra = 0;
+  wc.cbWndExtra = 0;
+  wc.hInstance = GetModuleHandle(NULL);
+  wc.hIcon = NULL;
+  wc.hCursor = NULL;
+  wc.hbrBackground = NULL;
+  wc.lpszMenuName = NULL;
+  wc.lpszClassName = aWindowClass;
+  ::RegisterClassW(&wc);
+}
+
+HWND
+nsWinUtils::CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd)
+{
+  return ::CreateWindowW(aWindowClass,
+                         L"NetscapeDispatchWnd",
+                         WS_CHILD | WS_VISIBLE,
+                         CW_USEDEFAULT, CW_USEDEFAULT,
+                         0, 0,
+                         aParentWnd,
+                         NULL,
+                         GetModuleHandle(NULL),
+                         NULL);
+}
+
+bool
+nsWinUtils::IsWindowEmulationEnabled()
+{
+  return ::GetModuleHandleW(kJAWSModuleHandle) ||
+    ::GetModuleHandleW(kWEModuleHandle)  ||
+    ::GetModuleHandleW(kDolphnModuleHandle);
+}
+
+bool
+nsWinUtils::IsTabDocument(nsIDocument* aDocumentNode)
+{
+  nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
+  nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
+
+  nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
+  treeItem->GetParent(getter_AddRefs(parentTreeItem));
+
+  nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
+  treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
+
+  return parentTreeItem == rootTreeItem;
+}
--- a/accessible/src/msaa/nsWinUtils.h
+++ b/accessible/src/msaa/nsWinUtils.h
@@ -39,22 +39,50 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsWinUtils_h_
 #define nsWinUtils_h_
 
 #include "Accessible2.h"
 
 #include "nsIArray.h"
+#include "nsIDocument.h"
+
+const LPCWSTR kClassNameRoot = L"MozillaUIWindowClass";
+const LPCWSTR kClassNameTabContent = L"MozillaContentWindowClass";
+
+const LPCWSTR kJAWSModuleHandle = L"jhook";
+const LPCWSTR kWEModuleHandle = L"gwm32inc";
+const LPCWSTR kDolphnModuleHandle = L"dolwinhk";
 
 class nsWinUtils
 {
 public:
   /**
    * Convert nsIArray array of accessible objects to an array of IUnknown*
    * objects used in IA2 methods.
    */
   static HRESULT ConvertToIA2Array(nsIArray *aCollection,
                                    IUnknown ***aAccessibles, long *aCount);
+
+  /**
+   * Helper to register window class.
+   */
+  static void RegisterNativeWindow(LPCWSTR aWindowClass);
+
+  /**
+   * Helper to create a window.
+   */
+  static HWND CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd);
+
+  /**
+   * Return true if window emulation is enabled.
+   */
+  static bool IsWindowEmulationEnabled();
+
+  /**
+   * Return true if the given document node is for tab document accessible.
+   */
+  static bool IsTabDocument(nsIDocument* aDocumentNode);
 };
 
 #endif
 
--- a/accessible/tests/mochitest/attributes/test_obj.html
+++ b/accessible/tests/mochitest/attributes/test_obj.html
@@ -1,13 +1,14 @@
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=475006
 https://bugzilla.mozilla.org/show_bug.cgi?id=391829
 https://bugzilla.mozilla.org/show_bug.cgi?id=581952
+https://bugzilla.mozilla.org/show_bug.cgi?id=558036
 -->
 <head>
   <title>Group attributes tests</title>
   <link rel="stylesheet" type="text/css"
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
@@ -34,16 +35,21 @@ https://bugzilla.mozilla.org/show_bug.cg
       testAttrs("grabbed", {"grabbed" : "true"}, true);
       testAttrs("dropeffect", {"dropeffect" : "copy"}, true);
       testAttrs("sortAscending", {"sort" : "ascending"}, true);
       testAttrs("sortDescending", {"sort" : "descending"}, true);
       testAttrs("sortNone", {"sort" : "none"}, true);
       testAttrs("sortOther", {"sort" : "other"}, true);
 
       // live object attribute
+      
+      // HTML
+      testAttrs("output", {"live" : "polite"}, true);
+
+      // ARIA
       testAttrs("live", {"live" : "polite"}, true);
       testAttrs("live2", {"live" : "polite"}, true);
       testAbsentAttrs("live3", {"live" : ""});
       testAttrs("log", {"live" : "polite"}, true);
       testAttrs("logAssertive", {"live" : "assertive"}, true);
       testAttrs("marquee", {"live" : "off"}, true);
       testAttrs("status", {"live" : "polite"}, true);
       testAttrs("timer", {"live" : "off"}, true);
@@ -103,16 +109,21 @@ https://bugzilla.mozilla.org/show_bug.cg
      title="Add support for container-live-role to object attributes">
     Mozilla Bug 391829
   </a>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=581952"
      title="Make explicit that aria-label is not an object attribute">
     Mozilla Bug 475006
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
+     title="make HTML <output> accessible">
+    Mozilla Bug 558036
+  </a>
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <!-- aria -->
   <div id="atomic" aria-atomic="true"></div>
@@ -125,16 +136,20 @@ https://bugzilla.mozilla.org/show_bug.cg
   <div id="checkedTreeitem" role="treeitem" aria-checked="true"></div>
   <div id="grabbed" aria-grabbed="true"></div>
   <div id="dropeffect" aria-dropeffect="copy"></div>
   <div id="sortAscending" role="columnheader" aria-sort="ascending"></div>
   <div id="sortDescending" role="columnheader" aria-sort="descending"></div>
   <div id="sortNone" role="columnheader" aria-sort="none"></div>
   <div id="sortOther" role="columnheader" aria-sort="other"></div>
 
+  <!-- html -->
+  <output id="output"></output>
+
+  <!-- back to aria -->
   <div id="live" aria-live="polite">excuse <div id="liveChild">me</div></div>
   <div id="live2" role="marquee" aria-live="polite">excuse <div id="live2Child">me</div></div>
   <div id="live3" role="region">excuse</div>
   <div id="log" role="log">excuse <div id="logChild">me</div></div>
   <div id="logAssertive" role="log" aria-live="assertive">excuse <div id="logAssertiveChild">me</div></div>
   <div id="marquee" role="marquee">excuse <div id="marqueeChild">me</div></div>
   <div id="status" role="status">excuse <div id="statusChild">me</div></div>
   <div id="timer" role="timer">excuse <div id="timerChild">me</div></div>
--- a/accessible/tests/mochitest/hyperlink/test_general.html
+++ b/accessible/tests/mochitest/hyperlink/test_general.html
@@ -8,21 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function testThis(aID, aAcc, aRole, aAnchors, aName, aValid, aStartIndex,
                       aEndIndex)
     {
       testRole(aAcc, aRole);
       is(aAcc.anchorCount, aAnchors, "Wrong number of anchors for ID "
                                       + aID + "!");
--- a/accessible/tests/mochitest/hyperlink/test_general.xul
+++ b/accessible/tests/mochitest/hyperlink/test_general.xul
@@ -7,21 +7,21 @@
         title="test for nsIAccessibleHyperLink interface on XUL:label elements">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function testThis(aID, aAcc, aRole, aAnchorCount, aAnchorName, aURI,
                       aStartIndex, aEndIndex, aValid, aSelectedBefore,
                       aSelectedAfter)
     {
       testRole(aID, aRole);
--- a/accessible/tests/mochitest/relations/test_general.html
+++ b/accessible/tests/mochitest/relations/test_general.html
@@ -80,16 +80,21 @@
       // aria-flowto, multiple relations
       testRelation("flowto1", RELATION_FLOWS_TO, ["flowfrom1", "flowfrom2"]);
       testRelation("flowfrom1", RELATION_FLOWS_FROM, "flowto1");
       testRelation("flowfrom2", RELATION_FLOWS_FROM, "flowto1");
 
       // 'default button' relation
       testRelation("input", RELATION_DEFAULT_BUTTON, "submit");
 
+      // output 'for' relations
+      testRelation("output", RELATION_CONTROLLED_BY, ["input", "input2"]);
+      testRelation("input", RELATION_CONTROLLER_FOR, "output");
+      testRelation("input2", RELATION_CONTROLLER_FOR, "output");
+
       // 'described by'/'description for' relation for html:table and
       // html:caption
       testRelation("caption", RELATION_DESCRIPTION_FOR, "table");
       testRelation("table", RELATION_DESCRIBED_BY, "caption");
 
       // 'labelled by'/'label for' relation for html:fieldset and
       // html:legend
       testRelation("legend", RELATION_LABEL_FOR, "fieldset");
@@ -120,16 +125,21 @@
 
 <body>
 
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=475298"
      title="mochitests for accessible relations">
     Mozilla Bug 475298
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
+     title="make HTML <output> accessible">
+    Mozilla Bug 558036
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <label id="label1" for="checkbox1">label</label>
   <input id="checkbox1" />
 
@@ -184,19 +194,21 @@
 
   <span id="flowto" aria-flowto="flowfrom">flow to</span>
   <span id="flowfrom">flow from</span>
 
   <span id="flowto1" aria-flowto="flowfrom1 flowfrom2">flow to</span>
   <span id="flowfrom1">flow from</span>
   <span id="flowfrom2">flow from</span>
 
-  <form>
+  <form id="form">
     <input id="input" />
+    <input id="input2" />
     <input type="submit" id="submit" />
+    <output id="output" style="display:block" for="input input2"></output>
   </form>
 
   <table id="table">
     <caption id="caption">tabple caption</caption>
     <tr>
       <td>cell1</td><td>cell2</td>
     </tr>
   </table>
--- a/accessible/tests/mochitest/selectable/test_listbox.xul
+++ b/accessible/tests/mochitest/selectable/test_listbox.xul
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
-                 type="text/css"?>
+<?xml-stylesheet href="../treeview.css" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="XUL tree selectable tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
--- a/accessible/tests/mochitest/selectable/test_menu.xul
+++ b/accessible/tests/mochitest/selectable/test_menu.xul
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
-                 type="text/css"?>
+<?xml-stylesheet href="../treeview.css" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="XUL tree selectable tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
--- a/accessible/tests/mochitest/selectable/test_menulist.xul
+++ b/accessible/tests/mochitest/selectable/test_menulist.xul
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
-                 type="text/css"?>
+<?xml-stylesheet href="../treeview.css" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="XUL tree selectable tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
--- a/accessible/tests/mochitest/tree/test_formctrl.html
+++ b/accessible/tests/mochitest/tree/test_formctrl.html
@@ -56,16 +56,26 @@
         children: [
           {
             role: ROLE_STATICTEXT
           }
         ]
       };
       testAccessibleTree("image_submit", accTree);
 
+      accTree = {
+        role: ROLE_SECTION,
+        children: [
+          {
+            role: ROLE_TEXT_LEAF
+          }
+        ]
+      };
+      testAccessibleTree("output", accTree);
+
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 <body>
@@ -75,22 +85,28 @@
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045">
     Mozilla Bug 342045
   </a>
   <a target="_blank"
     title="add test for role of input type='image'"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=524521">
      Mozilla Bug 524521
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
+     title="make HTML <output> accessible">
+    Mozilla Bug 558036
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <input type="checkbox" id="checkbox">
   <input type="radio" id="radio">
   <input type="button" value="button" id="btn1">
   <button id="btn2">button</button>
 
   <input type="submit" id="submit">
   <input type="image" id="image_submit">
+  <output id="output">1337</output>
 </body>
 </html>
--- a/accessible/tests/mochitest/tree/test_txtctrl.html
+++ b/accessible/tests/mochitest/tree/test_txtctrl.html
@@ -45,29 +45,17 @@
 
       testAccessibleTree("txc2", accTree);
 
       // textarea
       accTree = {
         role: ROLE_ENTRY,
         children: [
           {
-            role: ROLE_TEXT_LEAF // hello1 text
-          },
-          {
-            role: ROLE_WHITESPACE
-          },
-          {
-            role: ROLE_TEXT_LEAF, // hello2 text
-          },
-          {
-            role: ROLE_WHITESPACE
-          },
-          {
-            role: ROLE_TEXT_LEAF, // whitepsace text
+            role: ROLE_TEXT_LEAF // hello1\nhello2 text
           },
           {
             role: ROLE_WHITESPACE
           }
         ]
       };
 
       testAccessibleTree("txc3", accTree);
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/screen.css
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/screen.css
@@ -99,80 +99,80 @@ src: url('chrome://testpilot/skin/fonts/
 
 .button {
 	font-family: 'DroidSans';
 	font-size: 16px;
 	padding: 8px 12px;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
-	-moz-box-shadow: 
+	box-shadow: 
 		inset rgba(0, 0, 0, 0.2) 0 1px 1px,
 		inset rgba(255, 255, 255, 1) 0 3px 1px,
 		inset rgba(255, 255, 255, 0.3) 0 16px 0px,
 		inset rgba(0, 0, 0, 0.2) 0 -1px 1px,
 		inset rgba(0, 0, 0, 0.1) 0 -2px 1px, 
 		rgba(255, 255, 255, 1) 0 1px,
-		rgba(133, 153, 166, 0.3) 0px 1px 12px;
+		rgba(133, 153, 166, 0.3) 0px 1px 8.5px;
 	background-color: #e7eaec;
 	//display: inline;
 }
 
 .home_button {
 	font-family: 'DroidSans';
 	font-size: 16px;
 	padding: 8px 12px;
 	width: 240px;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
-	-moz-box-shadow: 
+	box-shadow: 
 		inset rgba(0, 0, 0, 0.2) 0 1px 1px,
 		inset rgba(255, 255, 255, 1) 0 3px 1px,
 		inset rgba(255, 255, 255, 0.3) 0 16px 0px,
 		inset rgba(0, 0, 0, 0.2) 0 -1px 1px,
 		inset rgba(0, 0, 0, 0.1) 0 -2px 1px, 
 		rgba(255, 255, 255, 1) 0 1px,
-		rgba(133, 153, 166, 0.3) 0px 1px 12px;
+		rgba(133, 153, 166, 0.3) 0px 1px 8.5px;
 	background-color: #e7eaec;
 	//display: inline;
 }
 
 
 .callout {
 	font-family: 'DroidSans';
 	font-size: 16px;
 	padding: 8px 24px;
 	margin: 24px auto;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
 	background: rgba(220, 240, 247, 0.8) url('chrome://testpilot/skin/callout.png') no-repeat top center;
-	-moz-box-shadow: 
-		inset rgba(185, 221, 234, 0.2) 0 -10px 12px,
+	box-shadow: 
+		inset rgba(185, 221, 234, 0.2) 0 -10px 8.5px,
 		inset rgba(185, 221, 234, 1) 0 0px 1px,
-		inset rgba(255, 255, 255, 0.2) 0 10px 12px;
+		inset rgba(255, 255, 255, 0.2) 0 10px 8.5px;
 	//display: inline;
 }
 
 .home_callout {
 	font-family: 'DroidSans';
 	font-size: 16px;
 	vertical-align: middle;
 	width: 240px;
 	padding: 8px 24px;
 	margin: 8px auto;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
 	background: rgba(220, 240, 247, 0.8) url('chrome://testpilot/skin/callout.png') no-repeat top center;
-	-moz-box-shadow: 
-		inset rgba(185, 221, 234, 0.2) 0 -10px 12px,
+	box-shadow: 
+		inset rgba(185, 221, 234, 0.2) 0 -10px 8.5px,
 		inset rgba(185, 221, 234, 1) 0 0px 1px,
-		inset rgba(255, 255, 255, 0.2) 0 10px 12px;
+		inset rgba(255, 255, 255, 0.2) 0 10px 8.5px;
 	//display: inline;
 }
 
 .homeIcon {
 	margin-top: -32px;
 	margin-bottom: -32px;
 	margin-right: 12px;
 }
@@ -218,18 +218,18 @@ src: url('chrome://testpilot/skin/fonts/
 }
 
 .menuOn {
 	margin-right: 30px;
 	margin-bottom: 40px;
 	font-size: 14px;
 	text-shadow: 1px 1px 1px rgba(173, 182, 186, 1);
 	background-color: rgba(173, 182, 186, 0.3);
-	-moz-box-shadow: 
-		inset rgba(0, 0, 0, 0.2) 0 -10px 12px;
+	box-shadow: 
+		inset rgba(0, 0, 0, 0.2) 0 -10px 8.5px;
 	padding: 9px 8px 8px 8px;
 }
 
 .menuItem a {color: #9f423b; text-decoration: none;}
 .menuItem a:hover {color: #9f423b; text-decoration: none; border-bottom: 1px dotted #9f423b;}
 
 
 .menuOn a {color: #666666; text-decoration: none;}
@@ -250,9 +250,9 @@ src: url('chrome://testpilot/skin/fonts/
 .function-link {
     cursor: pointer;
     color: #9f423b;
     text-decoration: underline;
 }
 
 p.embiggened {
     font-size: 14px;
-}
\ No newline at end of file
+}
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/skin/all/css/screen-standalone.css
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/skin/all/css/screen-standalone.css
@@ -37,18 +37,18 @@ body {
 	.data {
 	
 	    background-color: #fff;
         margin-bottom: 6px;
         border: 1px solid rgba(133, 153, 166, 0.2);
         border-bottom: 4px solid rgba(133, 153, 166, 0.2);
 		-moz-border-bottom-colors:rgba(133, 153, 166, 0.3) rgba(133, 153, 166, 0.2) rgba(133, 153, 166, 0.2) rgba(133, 153, 166, 0.2);
         padding: 6px;
-        -moz-box-shadow:
-			rgba(133, 153, 166, 0.4) 0px 1px 24px;
+        box-shadow:
+			rgba(133, 153, 166, 0.4) 0px 1px 17px;
 		-webkit-box-shadow:
 			rgba(133, 153, 166, 0.4) 0px 1px 24px;
 		
 	}
 	
 	.dataBox {
 		font-size: 16px;
 		padding: 6px 20px 20px 20px;
@@ -110,59 +110,59 @@ body {
 }
 
 .button {
 	font-size: 16px;
 	padding: 8px 12px;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
-	-moz-box-shadow: 
+	box-shadow: 
 		inset rgba(0, 0, 0, 0.2) 0 1px 1px,
 		inset rgba(255, 255, 255, 1) 0 3px 1px,
 		inset rgba(255, 255, 255, 0.3) 0 16px 0px,
 		inset rgba(0, 0, 0, 0.2) 0 -1px 1px,
 		inset rgba(0, 0, 0, 0.1) 0 -2px 1px, 
 		rgba(255, 255, 255, 1) 0 1px,
-		rgba(133, 153, 166, 0.3) 0px 1px 12px;
+		rgba(133, 153, 166, 0.3) 0px 1px 8.5px;
 	background-color: #e7eaec;
 	//display: inline;
 }
 
 .home_button {
 	font-size: 16px;
 	padding: 8px 12px;
 	width: 240px;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
-	-moz-box-shadow: 
+	box-shadow: 
 		inset rgba(0, 0, 0, 0.2) 0 1px 1px,
 		inset rgba(255, 255, 255, 1) 0 3px 1px,
 		inset rgba(255, 255, 255, 0.3) 0 16px 0px,
 		inset rgba(0, 0, 0, 0.2) 0 -1px 1px,
 		inset rgba(0, 0, 0, 0.1) 0 -2px 1px, 
 		rgba(255, 255, 255, 1) 0 1px,
-		rgba(133, 153, 166, 0.3) 0px 1px 12px;
+		rgba(133, 153, 166, 0.3) 0px 1px 8.5px;
 	background-color: #e7eaec;
 	//display: inline;
 }
 
 .callout {
 	font-size: 16px;
 	padding: 8px 24px;
 	margin: 24px auto;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
 	background: rgba(220, 240, 247, 0.8) url('chrome://testpilot/skin/images/callout.png') no-repeat top center;
-	-moz-box-shadow: 
-		inset rgba(185, 221, 234, 0.2) 0 -10px 12px,
+	box-shadow: 
+		inset rgba(185, 221, 234, 0.2) 0 -10px 8.5px,
 		inset rgba(185, 221, 234, 1) 0 0px 1px,
-		inset rgba(255, 255, 255, 0.2) 0 10px 12px;
+		inset rgba(255, 255, 255, 0.2) 0 10px 8.5px;
 	//display: inline;
 }
 
 #data-privacy-text {
   width: 320px;
   margin-bottom: 50px;
 }
 
@@ -171,37 +171,37 @@ body {
 	vertical-align: middle;
 	width: 280px;
 	padding: 8px 24px;
 	margin: 8px auto;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
 	background: rgba(220, 240, 247, 0.8) url('chrome://testpilot/skin/images/callout.png') no-repeat top center;
-	-moz-box-shadow: 
-		inset rgba(185, 221, 234, 0.2) 0 -10px 12px,
+	box-shadow: 
+		inset rgba(185, 221, 234, 0.2) 0 -10px 8.5px,
 		inset rgba(185, 221, 234, 1) 0 0px 1px,
-		inset rgba(255, 255, 255, 0.2) 0 10px 12px;
+		inset rgba(255, 255, 255, 0.2) 0 10px 8.5px;
 	//display: inline;
 }
 
 .home_callout_continue {
 	font-size: 16px;
 	vertical-align: middle;
 	width: 280px;
 	padding: 8px 24px;
 	margin: 8px auto;
 	color: rgba(0, 0, 0, 0.8);
 	border-radius: 0.5em;
 	-webkit-border-radius: 0.5em;
 	background: rgba(220, 240, 247, 0.8) url('chrome://testpilot/skin/images/callout_continue.png') no-repeat top center;
-	-moz-box-shadow: 
-		inset rgba(185, 221, 234, 0.2) 0 -10px 12px,
+	box-shadow: 
+		inset rgba(185, 221, 234, 0.2) 0 -10px 8.5px,
 		inset rgba(185, 221, 234, 1) 0 0px 1px,
-		inset rgba(255, 255, 255, 0.2) 0 10px 12px;
+		inset rgba(255, 255, 255, 0.2) 0 10px 8.5px;
 	//display: inline;
 }
 
 .home_callout_continue a {color: #6c9735; text-decoration: none;}
 .home_callout_continue a:hover {color: #6c9735; text-decoration: none; border-bottom: 1px dotted #6c9735;}
 
 
 .homeIcon {
@@ -258,18 +258,18 @@ body {
 }
 
 .menuOn {
 	margin-right: 30px;
 	margin-bottom: 40px;
 	font-size: 14px;
 	text-shadow: 1px 1px 1px rgba(173, 182, 186, 1);
 	background-color: rgba(173, 182, 186, 0.3);
-	-moz-box-shadow: 
-		inset rgba(0, 0, 0, 0.2) 0 -10px 12px;
+	box-shadow: 
+		inset rgba(0, 0, 0, 0.2) 0 -10px 8.5px;
 	padding: 9px 8px 8px 8px;
 }
 
 .menuItem a {color: #9f423b; text-decoration: none;}
 .menuItem a:hover {color: #9f423b; text-decoration: none; border-bottom: 1px dotted #9f423b;}
 
 
 .menuOn a {color: #666666; text-decoration: none;}
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/skin/linux/feedback.css
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/skin/linux/feedback.css
@@ -1,17 +1,17 @@
 #feedback-menu-button {
   -moz-appearance: button;
 }
 
 #pilot-notification-popup {
   -moz-appearance: none;
   background-color: Menu;
   background-image: -moz-linear-gradient(hsla(0,0%,100%,.2), transparent);
-  -moz-box-shadow: inset 0 0 10px hsla(0,0%,100%,.2),
+  box-shadow: inset 0 0 7px hsla(0,0%,100%,.2),
                    inset 0 1px 0 hsla(0,0%,100%,.3);
   border-radius: 4px;
   border: 1px solid Menu;
   margin: -6px 0 0 0;
   width: 480px;
 }
 
 .tail-up,
@@ -19,9 +19,9 @@
  -moz-border-image: none;
 }
 
 .pilot-notification-popup-container {
   -moz-appearance: none;
   margin: 0;
   padding: 10px;
   font-size: 14px;
-}
\ No newline at end of file
+}
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/skin/mac/feedback.css
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/skin/mac/feedback.css
@@ -4,27 +4,27 @@
   -moz-appearance: none;
   background: #666 
               -moz-linear-gradient(rgba(110,110,110,.9), rgba(70,70,70,.9) 49%,
                                    rgba(60,60,60,.9) 51%, rgba(50,50,50,.9));
   background-clip: padding-box;
   background-origin: padding-box;
   border-radius: 12px;
   border: 1px solid rgba(0,0,0,.65);
-  -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2),
+  box-shadow: inset 0 1px 0 rgba(255,255,255,.2),
                    inset 0 0 1px rgba(255,255,255,.1),
                    0 1px 0 rgba(255,255,255,.1);
   color: #fff;
   text-shadow: 0 -1px 0 rgba(0,0,0,.5);
 }
 
 #pilot-notification-submit:hover:active {
   background: -moz-linear-gradient(rgba(40,40,40,.9), rgba(70,70,70,.9));
-  -moz-box-shadow: inset 0 0 3px rgba(0,0,0,.2),
-                   inset 0 1px 7px rgba(0,0,0,.4),
+  box-shadow: inset 0 0 2px rgba(0,0,0,.2),
+                   inset 0 1px 5px rgba(0,0,0,.4),
                    0 1px 0 rgba(255,255,255,.1);
 }
 
 /* Text Colors */
 
 .pilot-notification-popup-container {
   color: #fff;
 }
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -65,35 +65,47 @@ pref("extensions.getAddons.search.url", 
 pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/%APP%/discovery/%VERSION%/%OS%");
 
 // Blocklist preferences
 pref("extensions.blocklist.enabled", true);
 pref("extensions.blocklist.interval", 86400);
 // Controls what level the blocklist switches from warning about items to forcibly
 // blocking them.
 pref("extensions.blocklist.level", 2);
-pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/");
+pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/");
 pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/");
 
+pref("extensions.update.autoUpdateDefault", true);
+
 // Dictionary download preference
 pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/%APP%/dictionaries/");
 
 // Update Timer Manager preferences
 // Interval: When all registered timers should be checked (in milliseconds)
 //           default=10 minutes
 pref("app.update.timer", 600000);
 
 // App-specific update preferences
 
 // The interval to check for updates (app.update.interval) is defined in
 // firefox-branding.js
 
+// Alternative windowtype for an application update user interface window. When
+// a window with this windowtype is open the application update service won't
+// open the normal application update user interface window.
+pref("app.update.altwindowtype", "Browser:About");
+
 // Enables some extra Application Update Logging (can reduce performance)
 pref("app.update.log", false);
 
+// The number of general background check failures to allow before notifying the
+// user of the failure. User initiated update checks always notify the user of
+// the failure.
+pref("app.update.backgroundMaxErrors", 10);
+
 // When |app.update.cert.requireBuiltIn| is true or not specified the
 // final certificate and all certificates the connection is redirected to before
 // the final certificate for the url specified in the |app.update.url|
 // preference must be built-in.
 pref("app.update.cert.requireBuiltIn", true);
 
 // When |app.update.cert.checkAttributes| is true or not specified the
 // certificate attributes specified in the |app.update.certs.| preference branch
@@ -114,17 +126,20 @@ pref("app.update.cert.maxErrors", 5);
 // 1. the uri scheme must be https
 // 2. the preference name must exist as an attribute name on the certificate and
 //    the value for the name must be the same as the value for the attribute name
 //    on the certificate.
 // If these conditions aren't met it will be treated the same as when there is
 // no update available. This validation will not be performed when using the
 // |app.update.url.override| preference for update checking.
 pref("app.update.certs.1.issuerName", "OU=Equifax Secure Certificate Authority,O=Equifax,C=US");
-pref("app.update.certs.1.commonName", "*.mozilla.org");
+pref("app.update.certs.1.commonName", "aus3.mozilla.org");
+
+pref("app.update.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
+pref("app.update.certs.2.commonName", "aus3.mozilla.org");
 
 // Whether or not app updates are enabled
 pref("app.update.enabled", true);
 
 // This preference turns on app.update.mode and allows automatic download and
 // install to take place. We use a separate boolean toggle for this to make
 // the UI easier to construct.
 pref("app.update.auto", true);
@@ -139,17 +154,17 @@ pref("app.update.auto", true);
 // See chart in nsUpdateService.js source for more details
 //
 pref("app.update.mode", 1);
 
 // If set to true, the Update Service will present no UI for any event.
 pref("app.update.silent", false);
 
 // Update service URL:
-pref("app.update.url", "https://aus2.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
+pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
 // app.update.url.manual is in branding section
 // app.update.url.details is in branding section
 
 // User-settable override to app.update.url for testing purposes.
 //pref("app.update.url.override", "");
 
 // app.update.interval is in branding section
 
@@ -400,25 +415,22 @@ pref("javascript.options.showInConsole",
 pref("general.warnOnAboutConfig",                 false);
 #endif
 
 #ifdef WINCE
 // Set the threshold higher to avoid some slow script warnings
 pref("dom.max_script_run_time",                   20);
 #endif
 
-// Make the status bar reliably present and unaffected by pages
-pref("dom.disable_window_open_feature.status",    true);
 // This is the pref to control the location bar, change this to true to 
-// force this instead of or in addition to the status bar - 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
+// 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);
-pref("dom.disable_window_status_change",          true);
 // allow JS to move and resize existing windows
 pref("dom.disable_window_move_resize",            false);
 // prevent JS from monkeying with window focus, etc
 pref("dom.disable_window_flip",                   true);
 
 // popups.policy 1=allow,2=reject
 pref("privacy.popups.policy",               1);
 pref("privacy.popups.usecustom",            true);
@@ -473,18 +485,18 @@ pref("intl.charset.detector", "chrome://
 pref("intl.charset.default",  "chrome://global-platform/locale/intl.properties");
 pref("font.language.group", "chrome://global/locale/intl.properties");
 pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties");
 pref("intl.menuitems.insertseparatorbeforeaccesskeys","chrome://global/locale/intl.properties");
 
 // simple gestures support
 pref("browser.gesture.swipe.left", "Browser:BackOrBackDuplicate");
 pref("browser.gesture.swipe.right", "Browser:ForwardOrForwardDuplicate");
-pref("browser.gesture.swipe.up", "cmd_scrollTop");
-pref("browser.gesture.swipe.down", "cmd_scrollBottom");
+pref("browser.gesture.swipe.up", "Browser:HideTabView");
+pref("browser.gesture.swipe.down", "Browser:ShowTabView");
 #ifdef XP_MACOSX
 pref("browser.gesture.pinch.latched", true);
 pref("browser.gesture.pinch.threshold", 150);
 #else
 pref("browser.gesture.pinch.latched", false);
 pref("browser.gesture.pinch.threshold", 25);
 #endif
 pref("browser.gesture.pinch.out", "cmd_fullZoomEnlarge");
@@ -775,24 +787,28 @@ pref("browser.sessionstore.resume_sessio
 // minimal interval between two save operations in milliseconds
 pref("browser.sessionstore.interval", 15000);
 // maximum amount of POSTDATA to be saved in bytes per history entry (-1 = all of it)
 // (NB: POSTDATA will be saved either entirely or not at all)
 pref("browser.sessionstore.postdata", 0);
 // on which sites to save text data, POSTDATA and cookies
 // 0 = everywhere, 1 = unencrypted sites, 2 = nowhere
 pref("browser.sessionstore.privacy_level", 1);
+// the same as browser.sessionstore.privacy_level, but for saving deferred session data
+pref("browser.sessionstore.privacy_level_deferred", 2);
 // how many tabs can be reopened (per window)
 pref("browser.sessionstore.max_tabs_undo", 10);
 // how many windows can be reopened (per session) - on non-OS X platforms this
 // pref may be ignored when dealing with pop-up windows to ensure proper startup
 pref("browser.sessionstore.max_windows_undo", 3);
 // number of crashes that can occur before the about:sessionrestore page is displayed
 // (this pref has no effect if more than 6 hours have passed since the last crash)
 pref("browser.sessionstore.max_resumed_crashes", 1);
+// number of tabs to restore concurrently
+pref("browser.sessionstore.max_concurrent_tabs", 3);
 
 // allow META refresh by default
 pref("accessibility.blockautorefresh", false);
 
 // Whether history is enabled or not.
 pref("places.history.enabled", true);
 
 // The percentage of system memory that the Places database can use.  Out of the
@@ -917,24 +933,23 @@ pref("browser.sessionstore.interval", 60
 pref("toolbar.customization.usesheet", true);
 #else
 pref("toolbar.customization.usesheet", false);
 #endif
 
 // The default for this pref reflects whether the build is capable of IPC.
 // (Turning it on in a no-IPC build will have no effect.)
 #ifdef XP_MACOSX
-// OSX still has only partial support for IPC.  Note that the PowerPC
-// and x86 builds must generate identical copies of this file, so we
-// can't make the prefs indicate that IPC is not available at all in
-// PowerPC builds.
-pref("dom.ipc.plugins.enabled", false);
-// These plug-ins will run OOP by default
-pref("dom.ipc.plugins.enabled.flash player.plugin", true);
-pref("dom.ipc.plugins.enabled.javaplugin2_npapi.plugin", true);
+// i386 ipc preferences
+pref("dom.ipc.plugins.enabled.i386", false);
+pref("dom.ipc.plugins.enabled.i386.flash player.plugin", true);
+pref("dom.ipc.plugins.enabled.i386.javaplugin2_npapi.plugin", true);
+// x86_64 ipc preferences
+pref("dom.ipc.plugins.enabled.x86_64", true);
+pref("dom.ipc.plugins.enabled.x86_64.test.plugin", false);
 #elifdef MOZ_IPC
 pref("dom.ipc.plugins.enabled", true);
 #else
 pref("dom.ipc.plugins.enabled", false);
 #endif
 
 #ifdef XP_WIN
 #ifndef WINCE
@@ -979,18 +994,16 @@ pref("services.sync.prefs.sync.browser.t
 pref("services.sync.prefs.sync.browser.tabs.warnOnOpen", true);
 pref("services.sync.prefs.sync.browser.urlbar.autocomplete.enabled", true);
 pref("services.sync.prefs.sync.browser.urlbar.autoFill", true);
 pref("services.sync.prefs.sync.browser.urlbar.default.behavior", true);
 pref("services.sync.prefs.sync.browser.urlbar.maxRichResults", true);
 pref("services.sync.prefs.sync.dom.disable_open_during_load", true);
 pref("services.sync.prefs.sync.dom.disable_window_flip", true);
 pref("services.sync.prefs.sync.dom.disable_window_move_resize", true);
-pref("services.sync.prefs.sync.dom.disable_window_open_feature.status", true);
-pref("services.sync.prefs.sync.dom.disable_window_status_change", true);
 pref("services.sync.prefs.sync.dom.event.contextmenu.enabled", true);
 pref("services.sync.prefs.sync.extensions.personas.current", true);
 pref("services.sync.prefs.sync.extensions.update.enabled", true);
 pref("services.sync.prefs.sync.general.autoScroll", true);
 pref("services.sync.prefs.sync.general.smoothScroll", true);
 pref("services.sync.prefs.sync.intl.accept_languages", true);
 pref("services.sync.prefs.sync.javascript.enabled", true);
 pref("services.sync.prefs.sync.layout.spellcheckDefault", true);
@@ -1029,8 +1042,13 @@ pref("services.sync.prefs.sync.spellchec
 pref("services.sync.prefs.sync.xpinstall.whitelist.required", true);
 #endif
 
 // Disable the Error Console
 pref("devtools.errorconsole.enabled", false);
 
 // disable the Inspector
 pref("devtools.inspector.enabled", false);
+
+// Whether the character encoding menu is under the main Firefox button. This
+// preference is a string so that localizers can alter it.
+pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
+
--- a/browser/base/content/aboutDialog.css
+++ b/browser/base/content/aboutDialog.css
@@ -1,106 +1,101 @@
 #aboutDialog {
   padding-top: 0;
   -moz-padding-end: 0;
   padding-bottom: 10px;
   -moz-padding-start: 0;
-  width: 299px;
-}
-
-#modes {
-  min-height: 400px;
+  width: 600px;
 }
 
 #clientBox {
-  /* Add a min-width equal to chrome://branding/content/about.png's
-   * width, to maintain the dialog layout on OS X where the dialog is
-   * align="end" to right-align the button.
-   */
-  min-width: 300px;
-  background-image: url("chrome://branding/content/about.png");
-  background-repeat: no-repeat;
-  background-color: #FFFFFF;
-  padding-top: 203px;
-  color: #000000;
+  background-color: #F7F7F7;
+  color: #222222;
 }
 
-#brandName {
-  font-weight: bold; font-size: larger;
+#leftBox {
+  background-image: url("chrome://branding/content/about-logo.png");
+  background-repeat: no-repeat;
+  /* min-width and min-height create room for the logo */
+  min-width: 210px;
+  min-height: 210px;
+  margin-top:20px;
+  -moz-margin-start: 30px;
 }
 
-#userAgent {
-  direction: ltr;
-  margin-top: 10px;
-  -moz-margin-end: 13px;
-  margin-bottom: 0;
-  -moz-margin-start: 13px;
-  background-color: #FFFFFF;
-  color: #000000;
-  padding-top: 1px;
-  -moz-padding-end: 1px;
-  padding-bottom: 1px;
-  -moz-padding-start: 3px;
-  -moz-appearance: none;
-  overflow: hidden;
-  border: 0;
+#rightBox {
+  background-image: url("chrome://branding/content/about-wordmark.png");
+  background-repeat: no-repeat;
+  /* padding-top creates room for the wordmark */
+  padding-top: 38px;
+  margin-top:20px;
+  -moz-margin-end: 30px;
+  -moz-margin-start: 30px;
 }
 
-#groove {
-  margin-top: 0;
+#rightBox:-moz-locale-dir(rtl) {
+  background-position: 100% 0;
 }
 
-#creditsIframe {
-  cursor: default;
-  -moz-user-select: none;
-  border: 0;
+#bottomBox {
+  padding: 15px 10px 0;
 }
 
 #version {
-  font-weight: bold;
-  color: #909090;
-  margin-top: 1em;
-  -moz-margin-end: 0;
-  margin-bottom: 10px;
-  -moz-margin-start: 17px;
+  margin-top: 5px;
+  -moz-margin-start: 0;
 }
 
-#distribution {
-  font-weight: bold;
-  color: #909090;
-  display: none;
-  margin-top: 0;
-  -moz-margin-end: 0;
-  margin-bottom: 0;
-  -moz-margin-start: 17px;
-}
-
+#distribution,
 #distributionId {
   font-weight: bold;
-  color: #909090;
   display: none;
   margin-top: 0;
-  -moz-margin-end: 0;
+  margin-bottom: 0;
+}
+
+.text-blurb {
   margin-bottom: 10px;
-  -moz-margin-start: 17px;
+  -moz-margin-start: 0;
+  -moz-padding-start: 0;
+}
+
+#updateBox {
+  margin-bottom: 10px;
 }
 
-#copyright {
-  margin-top: 0;
-  -moz-margin-end: 16px;
-  margin-bottom: 3px;
-  -moz-margin-start: 16px;
+#updateButton,
+#updateDeck > hbox > label {
+  -moz-margin-start: 0;
+  -moz-padding-start: 0;
 }
 
-button[dlgtype="extra2"] {
-  -moz-margin-start: 13px;
+#updateDeck > hbox > label:not([class="text-link"]) {
+  color: #909090;
+  font-style:italic;
 }
 
-button[dlgtype="accept"] {
-  -moz-margin-end: 13px;
+.update-throbber {
+  width: 16px;
+  min-height: 16px;
+  -moz-margin-end: 3px;
+  list-style-image: url("chrome://global/skin/icons/loading_16.png");
 }
 
+.trademark-label,
 .text-link,
 .text-link:focus {
   margin: 0px;
   padding: 0px;
-  border: 0px;
+}
+
+.bottom-link,
+.bottom-link:focus {
+  text-align: center;
+  margin: 0 40px;
 }
+
+#trademark {
+  font-size: xx-small;
+  text-align: center;
+  color: #999999;
+  margin-top: 10px;
+}
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -15,105 +15,525 @@
 #
 # The Initial Developer of the Original Code is
 # Blake Ross (blaker@netscape.com).
 # Portions created by the Initial Developer are Copyright (C) 2002
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Ehsan Akhgari <ehsan.akhgari@gmail.com>
+#   Margaret Leibovic <margaret.leibovic@gmail.com>
+#   Robert Strong <robert.bugzilla@gmail.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the LGPL or the GPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK ***** -->
 
-var gSelectedPage = 0;
+// Services = object with smart getters for common XPCOM services
+Components.utils.import("resource://gre/modules/Services.jsm");
 
 function init(aEvent)
 {
   if (aEvent.target != document)
     return;
 
-  var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                        .getService(Components.interfaces.nsIPrefBranch);
+  try {
+    var distroId = Services.prefs.getCharPref("distribution.id");
+    if (distroId) {
+      var distroVersion = Services.prefs.getCharPref("distribution.version");
+      var distroAbout = Services.prefs.getComplexValue("distribution.about",
+        Components.interfaces.nsISupportsString);
 
-  try {
-    var distroId = prefs.getCharPref("distribution.id");
-    if (distroId) {
-      var distroVersion = prefs.getCharPref("distribution.version");
-      var distroAbout = prefs.getComplexValue("distribution.about",
-        Components.interfaces.nsISupportsString);
-  
       var distroField = document.getElementById("distribution");
       distroField.value = distroAbout;
       distroField.style.display = "block";
-    
+
       var distroIdField = document.getElementById("distributionId");
       distroIdField.value = distroId + " - " + distroVersion;
       distroIdField.style.display = "block";
     }
   }
   catch (e) {
     // Pref is unset
   }
 
-  var userAgentField = document.getElementById("userAgent");
-  userAgentField.value = navigator.userAgent;
-
-  var button = document.documentElement.getButton("extra2");
-  button.setAttribute("label", document.documentElement.getAttribute("creditslabel"));
-  button.setAttribute("accesskey", document.documentElement.getAttribute("creditsaccesskey"));
-  button.addEventListener("command", switchPage, false);
-
-  var acceptButton = document.documentElement.getButton("accept");
-#ifdef XP_UNIX
-  acceptButton.setAttribute("icon", "close");
+#ifdef MOZ_UPDATER
+  gAppUpdater = new appUpdater();
 #endif
-  acceptButton.focus();
 
 #ifdef XP_MACOSX
   // it may not be sized at this point, and we need its width to calculate its position
   window.sizeToContent();
   window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5);
 #endif
 }
 
-function uninit(aEvent)
+#ifdef MOZ_UPDATER
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
+Components.utils.import("resource://gre/modules/AddonManager.jsm");
+
+var gAppUpdater;
+
+function onUnload(aEvent) {
+  if (gAppUpdater.isChecking)
+    gAppUpdater.checker.stopChecking(Components.interfaces.nsIUpdateChecker.CURRENT_CHECK);
+  // Safe to call even when there isn't a download in progress.
+  gAppUpdater.removeDownloadListener();
+  gAppUpdater = null;
+}
+
+
+function appUpdater()
 {
-  if (aEvent.target != document)
+  this.updateDeck = document.getElementById("updateDeck");
+
+  // Hide the update deck when there is already an update window open to avoid
+  // syncing issues between them.
+  if (Services.wm.getMostRecentWindow("Update:Wizard")) {
+    this.updateDeck.hidden = true;
     return;
-  var iframe = document.getElementById("creditsIframe");
-  iframe.setAttribute("src", "");
+  }
+
+  XPCOMUtils.defineLazyServiceGetter(this, "aus",
+                                     "@mozilla.org/updates/update-service;1",
+                                     "nsIApplicationUpdateService");
+  XPCOMUtils.defineLazyServiceGetter(this, "checker",
+                                     "@mozilla.org/updates/update-checker;1",
+                                     "nsIUpdateChecker");
+  XPCOMUtils.defineLazyServiceGetter(this, "um",
+                                     "@mozilla.org/updates/update-manager;1",
+                                     "nsIUpdateManager");
+  XPCOMUtils.defineLazyServiceGetter(this, "bs",
+                                     "@mozilla.org/extensions/blocklist;1",
+                                     "nsIBlocklistService");
+
+  this.bundle = Services.strings.
+                createBundle("chrome://browser/locale/browser.properties");
+
+  this.updateBtn = document.getElementById("updateButton");
+
+  // The button label value must be set so its height is correct.
+  this.setupUpdateButton("update.checkInsideButton");
+
+  let manualURL = Services.urlFormatter.formatURLPref("app.update.url.manual");
+  let manualLink = document.getElementById("manualLink");
+  manualLink.value = manualURL;
+  manualLink.href = manualURL;
+  document.getElementById("failedLink").href = manualURL;
+
+  if (this.updateDisabledAndLocked) {
+    this.selectPanel("adminDisabled");
+    return;
+  }
+
+  if (this.isPending) {
+    this.setupUpdateButton("update.restart." +
+                           (this.isMajor ? "upgradeButton" : "applyButton"));
+    return;
+  }
+
+  if (this.isDownloading) {
+    this.startDownload();
+    return;
+  }
+
+  if (this.updateEnabled && this.updateAuto) {
+    this.selectPanel("checkingForUpdates");
+    this.isChecking = true;
+    this.checker.checkForUpdates(this.updateCheckListener, true);
+    return;
+  }
 }
 
-function switchPage(aEvent)
+appUpdater.prototype =
 {
-  var button = aEvent.target;
-  if (button.localName != "button")
-    return;
+  // true when there is an update check in progress.
+  isChecking: false,
+
+  // true when there is an update already staged / ready to be applied.
+  get isPending() {
+    if (this.update)
+      return this.update.state == "pending";
+    return this.um.activeUpdate && this.um.activeUpdate.state == "pending";
+  },
+
+  // true when there is an update download in progress.
+  get isDownloading() {
+    if (this.update)
+      return this.update.state == "downloading";
+    return this.um.activeUpdate &&
+           this.um.activeUpdate.state == "downloading";
+  },
+
+  // true when the update type is major.
+  get isMajor() {
+    if (this.update)
+      return this.update.type == "major";
+    return this.um.activeUpdate.type == "major";
+  },
+
+  // true when updating is disabled by an administrator.
+  get updateDisabledAndLocked() {
+    return !this.updateEnabled &&
+           Services.prefs.prefIsLocked("app.update.enabled");
+  },
+
+  // true when updating is enabled.
+  get updateEnabled() {
+    try {
+      return Services.prefs.getBoolPref("app.update.enabled");
+    }
+    catch (e) { }
+    return true; // Firefox default is true
+  },
+
+  // true when updating is automatic.
+  get updateAuto() {
+    try {
+      return Services.prefs.getBoolPref("app.update.auto");
+    }
+    catch (e) { }
+    return true; // Firefox default is true
+  },
+
+  /**
+   * Sets the deck's selected panel.
+   *
+   * @param  aChildID
+   *         The id of the deck's child to select.
+   */
+  selectPanel: function(aChildID) {
+    this.updateDeck.selectedPanel = document.getElementById(aChildID);
+    this.updateBtn.disabled = (aChildID != "updateButtonBox");
+  },
+
+  /**
+   * Sets the update button's label and accesskey.
+   *
+   * @param  aKeyPrefix
+   *         The prefix for the properties file entry to use for setting the
+   *         label and accesskey.
+   */
+  setupUpdateButton: function(aKeyPrefix) {
+    this.updateBtn.label = this.bundle.GetStringFromName(aKeyPrefix + ".label");
+    this.updateBtn.accessKey = this.bundle.GetStringFromName(aKeyPrefix + ".accesskey");
+    if (!document.commandDispatcher.focusedElement ||
+        document.commandDispatcher.focusedElement.isSameNode(this.updateBtn))
+      this.updateBtn.focus();
+  },
+
+  /**
+   * Handles oncommand for the update button.
+   */
+  buttonOnCommand: function() {
+    if (this.isPending) {
+      // Notify all windows that an application quit has been requested.
+      let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].
+                       createInstance(Components.interfaces.nsISupportsPRBool);
+      Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
+
+      // Something aborted the quit process.
+      if (cancelQuit.data)
+        return;
+
+      // If already in safe mode restart in safe mode (bug 327119)
+      if (Services.appinfo.inSafeMode) {
+        let env = Components.classes["@mozilla.org/process/environment;1"].
+                  getService(Components.interfaces.nsIEnvironment);
+        env.set("MOZ_SAFE_MODE_RESTART", "1");
+      }
+
+      Components.classes["@mozilla.org/toolkit/app-startup;1"].
+      getService(Components.interfaces.nsIAppStartup).
+      quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
+           Components.interfaces.nsIAppStartup.eRestart);
+      return;
+    }
+
+    const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul";
+    // Firefox no longer displays a license for updates and the licenseURL check
+    // is just in case a distibution does.
+    if (this.update && (this.update.billboardURL || this.update.licenseURL ||
+        this.addons.length != 0)) {
+      var ary = null;
+      ary = Components.classes["@mozilla.org/supports-array;1"].
+            createInstance(Components.interfaces.nsISupportsArray);
+      ary.AppendElement(this.update);
+      var openFeatures = "chrome,centerscreen,dialog=no,resizable=no,titlebar,toolbar=no";
+      Services.ww.openWindow(null, URI_UPDATE_PROMPT_DIALOG, "", openFeatures, ary);
+      window.close();
+      return;
+    }
+
+    this.selectPanel("checkingForUpdates");
+    this.isChecking = true;
+    this.checker.checkForUpdates(this.updateCheckListener, true);
+  },
+
+  /**
+   * Implements nsIUpdateCheckListener. The methods implemented by
+   * nsIUpdateCheckListener have to be in a different scope from
+   * nsIIncrementalDownload because both nsIUpdateCheckListener and
+   * nsIIncrementalDownload implement onProgress.
+   */
+  updateCheckListener: {
+    /**
+     * See nsIUpdateService.idl
+     */
+    onProgress: function(aRequest, aPosition, aTotalSize) {
+    },
+
+    /**
+     * See nsIUpdateService.idl
+     */
+    onCheckComplete: function(aRequest, aUpdates, aUpdateCount) {
+      gAppUpdater.isChecking = false;
+      gAppUpdater.update = gAppUpdater.aus.
+                           selectUpdate(aUpdates, aUpdates.length);
+      if (!gAppUpdater.update) {
+        gAppUpdater.selectPanel("noUpdatesFound");
+        return;
+      }
+
+      if (!gAppUpdater.aus.canApplyUpdates) {
+        gAppUpdater.selectPanel("manualUpdate");
+        return;
+      }
+
+      // Firefox no longer displays a license for updates and the licenseURL
+      // check is just in case a distibution does.
+      if (gAppUpdater.update.billboardURL || gAppUpdater.update.licenseURL) {
+        gAppUpdater.selectPanel("updateButtonBox");
+        gAppUpdater.setupUpdateButton("update.openUpdateUI." +
+                                      (this.isMajor ? "upgradeButton"
+                                                    : "applyButton"));
+        return;
+      }
+
+      if (!gAppUpdater.update.appVersion ||
+          Services.vc.compare(gAppUpdater.update.appVersion,
+                              Services.appinfo.version) == 0) {
+        gAppUpdater.startDownload();
+        return;
+      }
+
+      gAppUpdater.checkAddonCompatibility();
+    },
+
+    /**
+     * See nsIUpdateService.idl
+     */
+    onError: function(aRequest, aUpdate) {
+      // Errors in the update check are treated as no updates found. If the
+      // update check fails repeatedly without a success the user will be
+      // notified with the normal app update user interface so this is safe.
+      gAppUpdater.isChecking = false;
+      gAppUpdater.selectPanel("noUpdatesFound");
+      return;
+    },
 
-  var iframe = document.getElementById("creditsIframe");
-  if (gSelectedPage == 0) {
-    iframe.setAttribute("src", "chrome://browser/content/credits.xhtml");
-    button.setAttribute("label", document.documentElement.getAttribute("aboutlabel"));
-    button.setAttribute("accesskey", document.documentElement.getAttribute("aboutaccesskey"));
-    gSelectedPage = 1;
+    /**
+     * See nsISupports.idl
+     */
+    QueryInterface: function(aIID) {
+      if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
+          !aIID.equals(Components.interfaces.nsISupports))
+        throw Components.results.NS_ERROR_NO_INTERFACE;
+      return this;
+    }
+  },
+
+  /**
+   * Checks the compatibility of add-ons for the application update.
+   */
+  checkAddonCompatibility: function() {
+    var self = this;
+    AddonManager.getAllAddons(function(aAddons) {
+      self.addons = [];
+      self.addonsCheckedCount = 0;
+      aAddons.forEach(function(aAddon) {
+        // If an add-on isn't appDisabled and isn't userDisabled then it is
+        // either active now or the user expects it to be active after the
+        // restart. If that is the case and the add-on is not installed by the
+        // application and is not compatible with the new application version
+        // then the user should be warned that the add-on will become
+        // incompatible. If an addon's type equals plugin it is skipped since
+        // checking plugins compatibility information isn't supported and
+        // getting the scope property of a plugin breaks in some environments
+        // (see bug 566787).
+        if (aAddon.type != "plugin" &&
+            !aAddon.appDisabled && !aAddon.userDisabled &&
+            aAddon.scope != AddonManager.SCOPE_APPLICATION &&
+            aAddon.isCompatible &&
+            !aAddon.isCompatibleWith(self.update.appVersion,
+                                     self.update.platformVersion))
+          self.addons.push(aAddon);
+      });
+      self.addonsTotalCount = self.addons.length;
+      if (self.addonsTotalCount == 0) {
+        self.startDownload();
+        return;
+      }
+
+      self.checkAddonsForUpdates();
+    });
+  },
+
+  /**
+   * Checks if there are updates for add-ons that are incompatible with the
+   * application update.
+   */
+  checkAddonsForUpdates: function() {
+    this.addons.forEach(function(aAddon) {
+      aAddon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED,
+                         this.update.appVersion,
+                         this.update.platformVersion);
+    }, this);
+  },
+
+  /**
+   * See XPIProvider.jsm
+   */
+  onCompatibilityUpdateAvailable: function(aAddon) {
+    for (var i = 0; i < this.addons.length; ++i) {
+      if (this.addons[i].id == aAddon.id) {
+        this.addons.splice(i, 1);
+        break;
+      }
+    }
+  },
+
+  /**
+   * See XPIProvider.jsm
+   */
+  onUpdateAvailable: function(aAddon, aInstall) {
+    if (!this.bs.isAddonBlocklisted(aAddon.id, aInstall.version,
+                                    this.update.appVersion,
+                                    this.update.platformVersion)) {
+      // Compatibility or new version updates mean the same thing here.
+      this.onCompatibilityUpdateAvailable(aAddon);
+    }
+  },
+
+  /**
+   * See XPIProvider.jsm
+   */
+  onUpdateFinished: function(aAddon) {
+    ++this.addonsCheckedCount;
+
+    if (this.addonsCheckedCount < this.addonsTotalCount)
+      return;
+
+    if (this.addons.length == 0) {
+      // Compatibility updates or new version updates were found for all add-ons
+      this.startDownload();
+      return;
+    }
+
+    this.selectPanel("updateButtonBox");
+    this.setupUpdateButton("update.openUpdateUI." +
+                           (this.isMajor ? "upgradeButton" : "applyButton"));
+  },
+
+  /**
+   * Starts the download of an update mar.
+   */
+  startDownload: function() {
+    if (!this.update)
+      this.update = this.um.activeUpdate;
+    this.update.QueryInterface(Components.interfaces.nsIWritablePropertyBag);
+    this.update.setProperty("foregroundDownload", "true");
+
+    this.aus.pauseDownload();
+    let state = this.aus.downloadUpdate(this.update, false);
+    if (state == "failed") {
+      this.selectPanel("downloadFailed");      
+      return;
+    }
+
+    this.downloadStatus = document.getElementById("downloadStatus");
+    this.downloadStatus.value =
+      DownloadUtils.getTransferTotal(0, this.update.selectedPatch.size);
+    this.selectPanel("downloading");
+    this.aus.addDownloadListener(this);
+  },
+
+  removeDownloadListener: function() {
+    this.aus.removeDownloadListener(this);
+  },
+
+  /**
+   * See nsIRequestObserver.idl
+   */
+  onStartRequest: function(aRequest, aContext) {
+  },
+
+  /**
+   * See nsIRequestObserver.idl
+   */
+  onStopRequest: function(aRequest, aContext, aStatusCode) {
+    switch (aStatusCode) {
+    case Components.results.NS_ERROR_UNEXPECTED:
+      if (this.update.selectedPatch.state == "download-failed" &&
+          (this.update.isCompleteUpdate || this.update.patchCount != 2)) {
+        // Verification error of complete patch, informational text is held in
+        // the update object.
+        this.removeDownloadListener();
+        this.selectPanel("downloadFailed");
+        break;
+      }
+      // Verification failed for a partial patch, complete patch is now
+      // downloading so return early and do NOT remove the download listener!
+      break;
+    case Components.results.NS_BINDING_ABORTED:
+      // Do not remove UI listener since the user may resume downloading again.
+      break;
+    case Components.results.NS_OK:
+      this.removeDownloadListener();
+      this.selectPanel("updateButtonBox");
+      this.setupUpdateButton("update.restart." +
+                             (this.isMajor ? "upgradeButton" : "applyButton"));
+      break;
+    default:
+      this.removeDownloadListener();
+      this.selectPanel("downloadFailed");
+      break;
+    }
+
+  },
+
+  /**
+   * See nsIProgressEventSink.idl
+   */
+  onStatus: function(aRequest, aContext, aStatus, aStatusArg) {
+  },
+
+  /**
+   * See nsIProgressEventSink.idl
+   */
+  onProgress: function(aRequest, aContext, aProgress, aProgressMax) {
+    this.downloadStatus.value =
+      DownloadUtils.getTransferTotal(aProgress, aProgressMax);
+  },
+
+  /**
+   * See nsISupports.idl
+   */
+  QueryInterface: function(aIID) {
+    if (!aIID.equals(Components.interfaces.nsIProgressEventSink) &&
+        !aIID.equals(Components.interfaces.nsIRequestObserver) &&
+        !aIID.equals(Components.interfaces.nsISupports))
+      throw Components.results.NS_ERROR_NO_INTERFACE;
+    return this;
   }
-  else {
-    iframe.setAttribute("src", ""); 
-    button.setAttribute("label", document.documentElement.getAttribute("creditslabel"));
-    button.setAttribute("accesskey", document.documentElement.getAttribute("creditsaccesskey"));
-    gSelectedPage = 0;
-  }
-  var modes = document.getElementById("modes");
-  modes.setAttribute("selectedIndex", gSelectedPage);
-}
-
+};
+#endif
--- a/browser/base/content/aboutDialog.xul
+++ b/browser/base/content/aboutDialog.xul
@@ -17,16 +17,18 @@
 #
 # The Initial Developer of the Original Code is
 # Blake Ross (blaker@netscape.com).
 # Portions created by the Initial Developer are Copyright (C) 2002
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Ehsan Akhgari <ehsan.akhgari@gmail.com>
+#   Margaret Leibovic <margaret.leibovic@gmail.com>
+#   Robert Strong <robert.bugzilla@gmail.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -46,60 +48,93 @@
 <!ENTITY % aboutDialogDTD SYSTEM "chrome://browser/locale/aboutDialog.dtd" >
 %aboutDialogDTD;
 ]>
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 #endif
 
-<dialog xmlns:html="http://www.w3.org/1999/xhtml"
+<window xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         id="aboutDialog"
         windowtype="Browser:About"
-        onload="init(event);" onunload="uninit(event);"
+        onload="init(event);"
+#ifdef MOZ_UPDATER
+        onunload="onUnload(event);"
+#endif
 #ifdef XP_MACOSX
         inwindowmenu="false"
-        buttons="extra2"
-        align="end"
 #else
         title="&aboutDialog.title;"
-        buttons="accept,extra2"
-#ifdef XP_UNIX
-        buttonlabelaccept="&closeCmdGNOME.label;"
-        buttonaccesskeyaccept="&closeCmdGNOME.accesskey;"
 #endif
-#endif
-        creditslabel="&copyright;"
-#ifdef XP_UNIX
-        creditsaccesskey="&copyrightGNOME.accesskey;"
-#else
-        creditsaccesskey="&copyright.accesskey;"
-#endif
-        aboutlabel="&aboutLink;"
-        aboutaccesskey="&aboutLink.accesskey;">
-    
+        >
+
   <script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/>
 
-  <deck id="modes" flex="1">
-    <vbox flex="1" id="clientBox">
-#expand <label id="version" value="&aboutVersion; __MOZ_APP_VERSION__"/>
-      <label id="distribution"/>
-      <label id="distributionId"/>
-      <description id="copyright">
-        <label
-        class="text-link" href="about:license"
-        >&licenseLinkText;</label>&licenseLinkSuffix;&trademarkInfo;
+  <vbox>
+    <hbox id="clientBox">
+      <vbox id="leftBox" flex="1"/>
+      <vbox id="rightBox" flex="1">
+#expand <label id="version" value="__MOZ_APP_VERSION__"/>
+        <label id="distribution" class="text-blurb"/>
+        <label id="distributionId" class="text-blurb"/>
+        <vbox id="updateBox">
+#ifdef MOZ_UPDATER
+          <deck id="updateDeck" orient="vertical">
+            <hbox id="updateButtonBox" align="center">
+              <button id="updateButton" align="start"
+                      oncommand="gAppUpdater.buttonOnCommand();"/>
+              <spacer flex="1"/>
+            </hbox>
+            <hbox id="checkingForUpdates" align="center">
+              <image class="update-throbber"/><label>&update.checkingForUpdates;</label>
+            </hbox>
+            <hbox id="checkingAddonCompat" align="center">
+              <image class="update-throbber"/><label>&update.checkingAddonCompat;</label>
+            </hbox>
+            <hbox id="downloading" align="center">
+              <image class="update-throbber"/><label>&update.downloading.start;</label><label id="downloadStatus"/><label>&update.downloading.end;</label>
+            </hbox>
+            <hbox id="downloadFailed" align="center">
+              <label>&update.failed.start;</label><label id="failedLink" class="text-link">&update.failed.linkText;</label><label>&update.failed.end;</label>
+            </hbox>
+            <hbox id="adminDisabled" align="center">
+              <label>&update.adminDisabled;</label>
+            </hbox>
+            <hbox id="noUpdatesFound" align="center">
+              <label>&update.noUpdatesFound;</label>
+            </hbox>
+            <hbox id="manualUpdate" align="center">
+              <label>&update.manual.start;</label><label id="manualLink" class="text-link"/><label>&update.manual.end;</label>
+            </hbox>
+          </deck>
+#endif
+        </vbox>
+        <description class="text-blurb">
+          &community.start2;<label class="text-link" href="http://www.mozilla.org/">&community.mozillaLink;</label>&community.middle2;<label class="text-link" href="about:credits">&community.creditsLink;</label>&community.end2;
+        </description>
+        <description class="text-blurb">
+          &contribute.start;<label class="text-link" href="http://www.mozilla.org/contribute/">&contribute.getInvolvedLink;</label>&contribute.end;
+        </description>
+      </vbox>
+    </hbox>
+    <vbox id="bottomBox">
+      <hbox pack="center">
+        <label class="text-link bottom-link" href="about:license">&bottomLinks.license;</label>
+        <label class="text-link bottom-link" href="about:rights">&bottomLinks.rights;</label>
+        <label class="text-link bottom-link" href="http://www.mozilla.com/legal/privacy/">&bottomLinks.privacy;</label>
+      </hbox>
+      <description id="trademark">
+        <label class="trademark-label">&trademarkInfo.part1;</label>
+        <label class="trademark-label">&trademarkInfo.part2;</label>
       </description>
-      <textbox id="userAgent" multiline="true" readonly="true" flex="1"/>
     </vbox>
-    <vbox flex="1" id="creditsBox">
-      <iframe id="creditsIframe" flex="1"/>
-    </vbox>    
-  </deck>
-  <separator class="groove" id="groove"/>
+  </vbox>
+  
+  <keyset>
+    <key keycode="VK_ESCAPE" oncommand="window.close();"/>
+  </keyset>
 
 #ifdef XP_MACOSX
 #include browserMountPoints.inc
 #endif
-
-</dialog>
-
+</window>
--- a/browser/base/content/aboutHome.css
+++ b/browser/base/content/aboutHome.css
@@ -50,17 +50,18 @@ html {
   margin: 1em auto;
   padding: 25px;
   width: 560px;
 }
 
 #brandStart {
   background: -moz-linear-gradient(top, #42607C, #1E4262 30%, #1E4262 80%, #143552 98%, #244665);
   border-radius: 5.6px;
-  padding-bottom: 0.2em;
+  padding-top: 0.1em;
+  padding-bottom: 0.1em;
   -moz-padding-start: 0.5em;
   font-size: 250%;
   font-weight: bold;
   color: #688196;
   margin-top: 18px;
   margin-bottom: 6px;
 }
 #brandStart > span {
@@ -104,8 +105,12 @@ body[dir="rtl"] #searchEngineLinks {
 
 #searchText {
   width: 100%;
 }
 
 #aboutMozilla {
   text-align: center;
 }
+
+#defaultSnippets {
+  text-align: center;
+}
--- a/browser/base/content/aboutHome.js
+++ b/browser/base/content/aboutHome.js
@@ -36,56 +36,72 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 // If a definition requires additional params, check that the final search url
 // is handled correctly by the engine.
 const SEARCH_ENGINES = {
   "Google": {
     image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAYCAMAAABwdHsxAAADAFBMVEVogZYwjM9NtOspS2u0KAfYZBb3rRTiurCMjYrUWhIaPlzDNgfVRgjaVgvoizTI9f2ta17/9Wzrs0v46M/+7VOW6vrJQAsBLochdr+nmF/++o+UDQK88vzaYQarq6scarXT+f68vLzjdRrjewp5d3WqGATkUwaTq9uk7PnUaydkICTJSBD4uCDgZAz9+LiK6PjRZFH33Xv01qbrlxznhgvwx5gCBCbOUhLjfCzhaxHztXG8RhX93UP5yTRGl9QhRGT5wigkRmXniRj70zoKWrT2yUdqjs3UhzXvl0JwU0teu+EBElGD2fH83FZo1vTPilT0vDmd0Z3dbhrWrHLhcQir8PzTTDfPrVGrajv03cf5+vkwUG6z8PrSUw571uzvpCGPTzBsPDMxMEcHagXrkg7voBHf/P8FGHHhzrbyryOQZAeDNCudnZyTJBL2zlT+xByoUCG1wspyY1nRiH7STA3yiB7Jjx/pqT/Pz8/7lhDvfBxTUkl95PY/RE0DI2SQbT7LzJjxdg1OMTzutynnm2v+5DWsNBX+/tVDqOa7tnX57OPGYSHysziEo5a3XBe3l3j+0SXCoaCsjTL++fMgQmLmxXdv0ezsv0ycQxf8p0X1hwrenDU/Tnj9//tkyNj3+fX89fDv22QXHEWQydee7/xEdKG84uRWi5bwaxyK3/L++/iU5PMWM2Q6GS7UXg81l9gmSGgXOVewsKO3x+ECK8h8x3j7/fs5bMBke6kuTmwoRV/SbArKeSrB1snY373x5aSIRz85YIvragDD5+lnorUvSWF80PCQr6o4KGKysrIeQmIgXJ1Vb4j///8+XXjs7ewaUZSutsKFkqY4T3IhXqgYSHtwiJwUNVLExcbk5eU4SGcrcLEsP1wPKV77+/vy8/NBkcBmrN+drLklNGIONHQ5WXVxyuk0VXHHz9dmxuonZahTrNqPobEcP19CVXMURIljzvE/odz29vYcP3VieZHo6OhCYHxOW29y2vNYwe79/f33+PnU2eExgcLX2Nje397NKLzjAAACjElEQVR42q2UMWvbQBTHPRgro6CDKIJOPQSeVH+CDuZ2E3BIVmNkBB5agTF0NYV00y7jdMji0XqxvNljAzmEPASrQ0Vwhk41tPZiC6l3OjmNXYeYujfo3nF3v/fe/+le5hX5HyOTzv1Of88bnXelq0q8C9NRHMcpFrHd3gPTD0qV17uisWeDqE269gyguU88pcrRDowNXrqYTt1/xkQwXi8mZ2Q/TO9vDNa2FVkJLUPocDsYDoe1lB6EURzZ4RrDThHi0RF7mRh+bFGirCEYCJnMLpzUase5XI2aZxhjKM6wS64YJlDZqWxAPEq6ztjFm01KEzGdTxGirgoNFpRfrU7IEg8IiQFoqRlmqYp0p4VGDEO8zB1sYoLyKJlFVCdxjotwntNpISJqYfjKMQKi1fDVvJlqg2G6gWmh98l8iuRoWL1O7Bc53b2TJoSFc88xquwKqig8SGyDFvxRMGyriEdDUF140+DR9HN6hGHOBJIsjinLpvHoV84EIPGCL/ClAzOiojzfKeejz9WX3H6ru98Td6GWaqOi3lbBQQsTlyzzOU1ajjimTgpUkxRDN7Uvtl1kmTGMgT5+28BcAAC/SBSJBl7mWS1kkwRVnpWvs8n1HP6nMswFQmJyp71+DK4mgZ0ssEarFsiyQe0sg9V03acnG2luClgcQx+DKaOyTwTjAUNiS5OKWFGwZbGYw5GsiqKYNI6erp8XTo7TGigAToecVSofjvrEzMuyPBIe9xvXux2MvXCZZroQhNU6a7/mJ5VsK87l+FaD2TLpTvTTbTbj7bb13PiJZ0zAT+u6PtH9nhuKxD270s0hGAfSBOCgaJLHxDrlffcQzOoXSKyYjksOwdDWOLcG2H5i8zf27La6kVLrqwAAAABJRU5ErkJggg=="
-  , params: "source=hp"
+  , params: "source=hp&channel=np"
   , links: {
       advanced: "http://www.google.com/advanced_search"
     , preferences: "http://www.google.com/preferences"
     }
   }
 
 , "Яндекс":
   {
     image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAArCAMAAAC5Mt3fAAABnlBMVEX/////AAD/AwP/Bgb/CQn/DAz/Dw//EhL/FRX/GBj/Gxv/Hh7/ISH/JCT/Jyf/MDD/MzP/Pz//QkL/SEj/S0v/Tk7/UVH/YGD/Zmb/aWn/bGz/cnL/dXX/eHj/e3v/fn7/hIT/jY3/k5P/lpb/mZn/nJz/n5//paX/q6v/rq7/tLT/w8P/xsb/z8//1dX/2Nj/29v/3t7/4eH/5OT/7e3/8PD/8/P/9vb/+fn//Pz8/Pz5+fn29vbz8/Pw8PDt7e3q6urn5+fk5OTh4eHe3t7b29vY2NjS0tLPz8/MzMzJycnGxsbDw8PAwMC9vb26urq0tLSurq6rq6uoqKilpaWioqKfn5+cnJyZmZmWlpaTk5ONjY2KioqHh4eEhISBgYF+fn57e3t4eHh1dXVycnJvb29sbGxpaWlmZmZjY2NgYGBdXV1aWlpXV1dUVFRRUVFOTk5LS0tISEhFRUVCQkI/Pz88PDw5OTk2NjYzMzMwMDAtLS0qKionJyckJCQhISEeHh4bGxsVFRUSEhIPDw8MDAwJCQkGBgYDAwMAAABXxKaDAAAAAXRSTlMAQObYZgAAA3pJREFUWMPt1ulbG1UUx/HfQVsUrK1a9612c6t16SZBlkpTKLIkiG26KBSLoTVUdpiUQiIJyfe/9sXcYZJJSFsfx1c9b5J57p18cu5y7pWex/OIPS6cPHrkBTOzQ/EZp9rNxcHYjPfMzOzVI50xIifN7OXPz0sn4kO+e9Hs8DkpVuQDs7azihfpajd7SzEjZ8zsdNzIcTM7Gzfyvpldiht5x8z0L5BE6s6t4f2bhzJTmSt1SDSTMvwiSXdhw28aJAj35vAmwGKPJOkeLEvSzyUYk6S+BQBWRh3yoZl9HUGAm5KUhUd+08geMuj/0ZL/tCTXb01Sd8H/VN9j1/meQ043WV1NkarnPQ6QRB7WU9O4jB1yAxiWpAXYuTGeo9gTbHgze/NpkJKfz6AkXYdSn3QfNkMksQ3zkjQO1VFJ6bG9SXnNrO3Mk5AUFGuQDXgg6RqQ3EMmoZKUpFVYiKyDL82s85snI1shMgCkJSXKkAmQxCbMyrWmmhQvO3js25bIBGyEyKTLQHn4I0DS/hBKN6H6Q8Oaftes/tBqRDLwV4jMQiUhScv++srCmjz4VZL0595bdfFpRwOSy2QymdW97lOQDZEFKEqSFmHdISkodsul93C/KvlKeDIShkPmYDpE8rDrVcIOWfDybjlLJTc30XjD7MD5ujmJIEswESKFSIcs7AK3/HoDzDQxvjCzj+snPjJcBUiGyN9QmHvoeZ7nefNuuBZxe6+3OdJ12Kz9QqvV1QvlRIjswGLtD2RhbRi4I0l9NB2uE2Z2rOU+GYdVhci2q1G1iJZhp9cN13yDcbHD7KWLLZEZf3kGyDpsNyAjwLT8PPMNyEdm9knrHe/5JT5A7gP9UUQrUO6XtALVvohx7oBZx6WWSBJWpPodf7sBGXO1fQa/2NTG22Z2vHWBvOvOogDp2YXiQBTRBlR+lIaAYn0qX7WZdX7fEukpuXkeCQ6MLFC4GkVSwJykNWBjoBZ53cxOtTxPbm9B0fM8/9AqPpB0uQSwPDfvlSdCRB5Uk9JQBagszS3mC+E+PNTVEslRFwVJGqsEj7M1SBrISRrdCVovS5KOmrV9Fp7E7ZKkKkyGF4lmiIYeAVD6vd+/SKwEBbN6VdLgll9y0k99+cm5vNytxQ2BfspMXb/Wvd9LY5nfJpLPcDPbB/lv439BspTHg+9XKv417hniH6z+4JNllI0iAAAAAElFTkSuQmCC"
   }
 };
 
+// The process of adding a new default snippet involves:
+//   * add a new entity to aboutHome.dtd
+//   * add a <span/> for it in aboutHome.xhtml
+//   * add an entry here in the proper ordering (based on spans)
+// The <a/> part of the snippet will be linked to the corresponding url.
+const DEFAULT_SNIPPETS_URLS = [
+  "http://www.mozilla.com/firefox/4.0/features"
+, "https://addons.mozilla.org/firefox/?browse=featured"
+];
+
+const SNIPPETS_UPDATE_INTERVAL_MS = 86400000; // 1 Day.
+
 let gSearchEngine;
 
 function onLoad(event)
 {
   setupSearchEngine();
   document.getElementById("searchText").focus();
+
+  loadSnippets();
 }
 
 
-function onSearchSubmit(aEvent) {
+function onSearchSubmit(aEvent)
+{
   let searchTerms = document.getElementById("searchText").value;
   if (gSearchEngine && searchTerms.length > 0) {
     const SEARCH_TOKENS = {
       "_searchTerms_": encodeURIComponent(searchTerms)
     }
     let url = gSearchEngine.searchUrl;
     for (let key in SEARCH_TOKENS) {
       url = url.replace(key, SEARCH_TOKENS[key]);
     }
     window.location.href = url;
   }
 
   aEvent.preventDefault();
 }
 
 
-function setupSearchEngine() {
+function setupSearchEngine()
+{
   gSearchEngine = JSON.parse(localStorage["search-engine"]);
 
   // Look for extended information, like logo and links.
   let searchEngineInfo = SEARCH_ENGINES[gSearchEngine.name];
   if (searchEngineInfo) {
     for (let prop in searchEngineInfo)
       gSearchEngine[prop] = searchEngineInfo[prop];
   }
@@ -110,8 +126,68 @@ function setupSearchEngine() {
     }
     if (gSearchEngine.links.preferences) {
       let prefsLink = document.getElementById("searchEngineAdvancedPreferences");
       prefsLink.setAttribute("href", gSearchEngine.links.preferences);
       prefsLink.hidden = false;
     }
   }
 }
+
+function loadSnippets()
+{
+  // Check last snippets update.
+  let lastUpdate = localStorage["snippets-last-update"];
+  let updateURL = localStorage["snippets-update-url"];
+  if (updateURL && (!lastUpdate ||
+                    Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS)) {
+    // Try to update from network.
+    let xhr = new XMLHttpRequest();
+    xhr.open('GET', updateURL, true);
+    xhr.onerror = function (event) {
+      showSnippets();
+    };
+    xhr.onload = function (event)
+    {
+      if (xhr.status == 200) {
+        localStorage["snippets"] = xhr.responseText;
+        localStorage["snippets-last-update"] = Date.now();
+      }
+      showSnippets();
+    };
+    xhr.send(null);
+  } else {
+    showSnippets();
+  }
+}
+
+function showSnippets()
+{
+  let snippets = localStorage["snippets"];
+  if (snippets) {
+    let snippetsElt = document.getElementById("snippets");
+    snippetsElt.innerHTML = snippets;
+    // Scripts injected by innerHTML are inactive, so we have to relocate them
+    // through DOM manipulation to activate their contents.
+    Array.forEach(snippetsElt.getElementsByTagName("script"), function(elt) {
+      let relocatedScript = document.createElement("script");
+      relocatedScript.type = "text/javascript;version=1.8";
+      relocatedScript.text = elt.text;
+      snippetsElt.replaceChild(relocatedScript, elt);
+    });
+    snippetsElt.hidden = false;
+  } else {
+    // If there are no saved snippets, show one of the default ones.
+    let defaultSnippetsElt = document.getElementById("defaultSnippets");
+    let entries = defaultSnippetsElt.querySelectorAll("span");
+    // Choose a random snippet.  Assume there is always at least one.
+    let randIndex = Math.round(Math.random() * (entries.length - 1));
+    let entry = entries[randIndex];
+    // Inject url in the eventual link.
+    if (DEFAULT_SNIPPETS_URLS[randIndex]) {
+      let links = entry.getElementsByTagName("a");
+      if (links.length != 1)
+        return; // Something is messed up in this entry, we support just 1 link.
+      links[0].href = DEFAULT_SNIPPETS_URLS[randIndex];
+    }
+    entry.hidden = false;
+  }
+}
--- a/browser/base/content/aboutHome.xhtml
+++ b/browser/base/content/aboutHome.xhtml
@@ -76,17 +76,21 @@
             <input type="submit" value="&abouthome.searchEngineButton.label;"/>
             <span id="searchEngineLinks">
               <a hidden="true" id="searchEngineAdvancedLink">&abouthome.searchEngineLinks.advanced;</a>
               <a hidden="true" id="searchEngineAdvancedPreferences">&abouthome.searchEngineLinks.preferences;</a>
             </span>
           </form>
         </div>
       </div>
-
+      <div id="defaultSnippets">
+        <span hidden="true">&abouthome.defaultSnippet1.v1;</span>
+        <span hidden="true">&abouthome.defaultSnippet2.v1;</span>
+      </div>
+      <div id="snippets" hidden="true"/>
       <div id="bottomSection">
         <div id="aboutMozilla">
           <a href="http://www.mozilla.com/about/">&abouthome.aboutMozilla;</a>
         </div>
       </div>
     </div>
   </body>
 </html>
--- a/browser/base/content/baseMenuOverlay.xul
+++ b/browser/base/content/baseMenuOverlay.xul
@@ -103,23 +103,30 @@
                   label="&helpReleaseNotes.label;"
                   oncommand="openReleaseNotes()"
                   onclick="checkForMiddleClick(this, event);"/>
         <menuitem id="feedbackPage"
                   accesskey="&helpFeedbackPage.accesskey;"
                   label="&helpFeedbackPage.label;"
                   oncommand="openFeedbackPage()"
                   onclick="checkForMiddleClick(this, event);"/>
+        <menuitem id="helpSafeMode"
+                  accesskey="&helpSafeMode.accesskey;"
+                  label="&helpSafeMode.label;"
+                  oncommand="safeModeRestart();"/>
+        <menuseparator/>
         <menuseparator id="updateSeparator"/>
+#ifdef XP_MACOSX
 #ifdef MOZ_UPDATER
         <menuitem id="checkForUpdates"
                   label="&updateCmd.label;"
                   class="menuitem-iconic"
                   oncommand="checkForUpdates();"/>
 #endif
+#endif
         <menuseparator id="aboutSeparator"/>
         <menuitem id="aboutName"
                   accesskey="&aboutProduct.accesskey;"
                   label="&aboutProduct.label;"
                   oncommand="openAboutDialog();"/>
       </menupopup>
     </menu>
 
--- a/browser/base/content/browser-doctype.inc
+++ b/browser/base/content/browser-doctype.inc
@@ -14,10 +14,12 @@
 <!ENTITY % customizeToolbarDTD SYSTEM "chrome://global/locale/customizeToolbar.dtd">
   %customizeToolbarDTD;
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 #ifdef MOZ_SAFE_BROWSING
 <!ENTITY % safebrowsingDTD SYSTEM "chrome://browser/locale/safebrowsing/phishing-afterload-warning-message.dtd">
 %safebrowsingDTD;
 #endif
+<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
+%aboutHomeDTD;
 ]>
 
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -108,16 +108,17 @@
 #ifndef XP_MACOSX
                 <menuseparator/>
 #endif
 #endif
                 <menuitem id="goOfflineMenuitem"
                           label="&goOfflineCmd.label;"
                           accesskey="&goOfflineCmd.accesskey;"
                           type="checkbox"
+                          observes="workOfflineMenuitemState"
                           oncommand="BrowserOffline.toggleOfflineStatus();"/>
                 <menuitem id="menu_FileQuitItem"
 #ifdef XP_WIN
                           label="&quitApplicationCmdWin.label;"
                           accesskey="&quitApplicationCmdWin.accesskey;"
 #else
 #ifdef XP_MACOSX
                           label="&quitApplicationCmdMac.label;"
@@ -204,18 +205,19 @@
 #endif
               </menupopup>
             </menu>
 
             <menu id="view-menu" label="&viewMenu.label;"
                   accesskey="&viewMenu.accesskey;">
               <menupopup id="menu_viewPopup">
                 <menuitem id="menu_tabview"
-                          label="&showTabView2.label;"
-                          accesskey="&showTabView2.accesskey;"
+                          key="key_tabview"
+                          label="&viewTabGroups.label;"
+                          accesskey="&viewTabGroups.accesskey;"
                           command="Browser:ToggleTabView"/>
                 <menu id="viewToolbarsMenu"
                       label="&viewToolbarsMenu.label;"
                       accesskey="&viewToolbarsMenu.accesskey;">
                   <menupopup onpopupshowing="onViewToolbarsPopupShowing(event);">
                     <menuseparator/>
                     <menuitem id="menu_tabsOnTop"
                               command="cmd_ToggleTabsOnTop"
@@ -224,26 +226,16 @@
                               accesskey="&viewTabsOnTop.accesskey;"/>
                     <menuseparator/>
                     <menuitem id="menu_customizeToolbars"
                               label="&viewCustomizeToolbar.label;"
                               accesskey="&viewCustomizeToolbar.accesskey;"
                               command="cmd_CustomizeToolbars"/>
                   </menupopup>
                 </menu>
-                <menuitem id="toggle_taskbar"
-                          label="&taskbarCmd.label;"
-                          accesskey="&taskbarCmd.accesskey;"
-                          type="checkbox"
-                          command="cmd_toggleTaskbar"
-#ifndef WINCE
-                          checked="true" />
-#else
-                          checked="false" />
-#endif
                 <menu id="viewSidebarMenuMenu"
                       label="&viewSidebarMenu.label;"
                       accesskey="&viewSidebarMenu.accesskey;">
                   <menupopup id="viewSidebarMenu">
                     <menuitem id="menu_bookmarksSidebar"
                               key="viewBookmarksSidebarKb"
                               observes="viewBookmarksSidebar"
                               accesskey="&bookmarksButton.accesskey;"/>
@@ -392,16 +384,21 @@
                                class="hide-if-empty-places-result"
                                builder="end"/>
 #ifdef MOZ_SERVICES_SYNC
                 <menuitem id="sync-tabs-menuitem"
                           label="&syncTabsMenu.label;"
                           oncommand="BrowserOpenSyncTabs();"
                           disabled="true"/>
 #endif
+                <menuitem id="historyRestoreLastSession"
+                          class="restoreLastSession"
+                          label="&historyRestoreLastSession.label;"
+                          oncommand="restoreLastSession();"
+                          disabled="true"/>
                 <menu id="historyUndoMenu"
                       class="recentlyClosedTabsMenu"
                       label="&historyUndoMenu.label;"
                       disabled="true">
                   <menupopup id="historyUndoPopup"
 #ifndef XP_MACOSX
                              placespopup="true"
 #endif
@@ -503,39 +500,23 @@
                         accesskey="&addons.accesskey;"
                         key="key_openAddons"
                         command="Tools:Addons"/>
 #ifdef MOZ_SERVICES_SYNC
               <!-- only one of sync-setup or sync-menu will be showing at once -->
               <menuitem id="sync-setup"
                         label="&syncSetup.label;"
                         accesskey="&syncSetup.accesskey;"
+                        observes="sync-setup-state"
                         oncommand="gSyncUI.openSetup()"/>
-              <menu id="sync-menu"
-                    label="&syncMenu.label;"
-                    accesskey="&syncMenu.accesskey;">
-                <menupopup id="sync-menu-popup"
-                           onpopupshowing="if (event.target == this) gSyncUI.doUpdateMenu(event);">
-                  <menuitem id="sync-loginitem"
-                            label="&syncLogInItem.label;"
-                            accesskey="&syncLogInItem.accesskey;"
-                            oncommand="gSyncUI.doLogin();"/>
-                  <menuitem id="sync-logoutitem"
-                            label="&syncLogOutItem.label;"
-                            accesskey="&syncLogOutItem.accesskey;"
-                            oncommand="gSyncUI.doLogout();"/>
-                  <menuitem id="sync-syncnowitem"
-                            label="&syncSyncNowItem.label;"
-                            accesskey="&syncSyncNowItem.accesskey;"
-                            oncommand="gSyncUI.doSync(event);"/>
-                  <menuseparator id="sync-lastsyncsep" hidden="true"/>
-                  <menuitem id="sync-lastsyncitem"
-                            disabled="true" hidden="true"/>
-                </menupopup>
-              </menu>
+              <menuitem id="sync-syncnowitem"
+                        label="&syncSyncNowItem.label;"
+                        accesskey="&syncSyncNowItem.accesskey;"
+                        observes="sync-syncnow-state"
+                        oncommand="gSyncUI.doSync(event);"/>
 #endif
               <menuseparator id="devToolsSeparator"/>
               <menuitem id="menu_pageinspect"
                         type="checkbox"
                         hidden="true"
                         label="&inspectMenu.label;"
                         accesskey="&inspectMenu.accesskey;"
                         key="key_inspect"
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -630,18 +630,19 @@ HistoryMenu.prototype = {
         if (/^https?:/.test(iconURL))
           iconURL = "moz-anno:favicon:" + iconURL;
         m.setAttribute("image", iconURL);
       }
       m.setAttribute("class", "menuitem-iconic bookmark-item menuitem-with-favicon");
       m.setAttribute("value", i);
       m.setAttribute("oncommand", "undoCloseTab(" + i + ");");
 
-      // Set the targetURI attribute so it will be shown in tooltip and statusbar.
-      // SessionStore uses one-based indexes, so we need to normalize them.
+      // Set the targetURI attribute so it will be shown in tooltip and trigger
+      // onLinkHovered. SessionStore uses one-based indexes, so we need to
+      // normalize them.
       let tabData = undoItems[i].state;
       let activeIndex = (tabData.index || tabData.entries.length) - 1;
       if (activeIndex >= 0 && tabData.entries[activeIndex])
         m.setAttribute("targetURI", tabData.entries[activeIndex].url);
 
       m.addEventListener("click", this._undoCloseMiddleClick, false);
       if (i == 0)
         m.setAttribute("key", "key_undoCloseTab");
@@ -711,17 +712,17 @@ HistoryMenu.prototype = {
         // don't initiate a connection just to fetch a favicon (see bug 467828)
         if (/^https?:/.test(iconURL))
           iconURL = "moz-anno:favicon:" + iconURL;
         m.setAttribute("image", iconURL);
       }
       m.setAttribute("class", "menuitem-iconic bookmark-item menuitem-with-favicon");
       m.setAttribute("oncommand", "undoCloseWindow(" + i + ");");
 
-      // Set the targetURI attribute so it will be shown in tooltip and statusbar.
+      // Set the targetURI attribute so it will be shown in tooltip.
       // SessionStore uses one-based indexes, so we need to normalize them.
       let activeIndex = (selectedTab.index || selectedTab.entries.length) - 1;
       if (activeIndex >= 0 && selectedTab.entries[activeIndex])
         m.setAttribute("targetURI", selectedTab.entries[activeIndex].url);
 
       if (i == 0)
         m.setAttribute("key", "key_undoCloseWindow");
       undoPopup.appendChild(m);
@@ -753,26 +754,36 @@ HistoryMenu.prototype = {
     // is modified), so make sure we avoid undefined errors.
     let enabled = Weave.Service.isLoggedIn && Weave.Engines.get("tabs") &&
                   Weave.Engines.get("tabs").enabled;
     menuitem.setAttribute("disabled", !enabled);
     menuitem.setAttribute("hidden", false);
 #endif
   },
 
+  toggleRestoreLastSession: function PHM_toggleRestoreLastSession() {
+    let restoreItem = this._rootElt.getElementsByClassName("restoreLastSession")[0];
+
+    if (this._ss.canRestoreLastSession)
+      restoreItem.removeAttribute("disabled");
+    else
+      restoreItem.setAttribute("disabled", true);
+  },
+
   _onPopupShowing: function HM__onPopupShowing(aEvent) {
     PlacesMenu.prototype._onPopupShowing.apply(this, arguments);
 
     // Don't handle events for submenus.
     if (aEvent.target != aEvent.currentTarget)
       return;
 
     this.toggleRecentlyClosedTabs();
     this.toggleRecentlyClosedWindows();
     this.toggleTabsFromOtherComputers();
+    this.toggleRestoreLastSession();
   },
 
   _onCommand: function HM__onCommand(aEvent) {
     let placesNode = aEvent.target._placesNode;
     if (placesNode) {
       PlacesUIUtils.markPageAsTyped(placesNode.uri);
       openUILink(placesNode.uri, aEvent, false, true);
     }
@@ -1149,19 +1160,17 @@ let BookmarksMenuButton = {
       return;
     this._popupNeedsUpdating = false;
 
     let viewToolbar = document.getElementById("BMB_viewBookmarksToolbar");
     if (!this._popupInitialized) {
       // First popupshowing event, initialize immutable attributes.
       this._popupInitialized = true;
       // Update View bookmarks toolbar checkbox menuitem.
-      viewToolbar.setAttribute("toolbarindex",
-                               Array.indexOf(gNavToolbox.childNodes,
-                                             this.personalToolbar));
+      viewToolbar.setAttribute("toolbarId", this.personalToolbar.id);
 
       // Need to set the label on Unsorted Bookmarks menu.
       let unsortedBookmarksElt =
         document.getElementById("BMB_unsortedBookmarksFolderMenu");
       unsortedBookmarksElt.label =
         PlacesUtils.getString("UnsortedBookmarksFolderTitle");
     }
 
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -64,17 +64,16 @@
     <command id="Browser:SendLink"
              oncommand="MailIntegration.sendLinkForWindow(window.content);"/>
 
     <command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
     <command id="cmd_print" oncommand="PrintUtils.print();"/>
     <command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
     <command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
     <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
-    <command id="cmd_toggleTaskbar" oncommand="goToggleToolbar('status-bar','toggle_taskbar');"/>
     <command id="cmd_ToggleTabsOnTop" oncommand="TabsOnTop.toggle()"/>
     <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
     <command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
 
 
     <commandset id="editMenuCommands"/>
 
     <command id="View:PageSource" oncommand="BrowserViewSourceOfDocument(content.document);" observes="isImage"/>
@@ -113,16 +112,18 @@
     </command>
     <command id="Browser:ReloadSkipCache" oncommand="BrowserReloadSkipCache()" disabled="true">
       <observes element="Browser:Reload" attribute="disabled"/>
     </command>
     <command id="Browser:NextTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);"/>
     <command id="Browser:PrevTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);"/>
     <command id="Browser:ShowAllTabs" oncommand="allTabs.open();"/>
     <command id="Browser:ToggleTabView" oncommand="TabView.toggle();"/>
+    <command id="Browser:ShowTabView" oncommand="TabView.show();"/>
+    <command id="Browser:HideTabView" oncommand="TabView.hide();"/>    
     <command id="cmd_fullZoomReduce"  oncommand="FullZoom.reduce()"/>
     <command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/>
     <command id="cmd_fullZoomReset"   oncommand="FullZoom.reset()"/>
     <command id="cmd_fullZoomToggle"  oncommand="ZoomManager.toggleZoom();"/>
     <command id="Browser:OpenLocation" oncommand="openLocation();"/>
 
     <command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
     <command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
@@ -186,16 +187,22 @@
                  accesskey="&dontShowMessage.accesskey;"
                  type="checkbox"
                  oncommand="gPopupBlockerObserver.dontShowMessage();"/>
     <broadcaster id="blockedPopupsSeparator"/>
     <broadcaster id="isImage"/>
     <broadcaster id="isFrameImage"/>
     <broadcaster id="singleFeedMenuitemState" disabled="true"/>
     <broadcaster id="multipleFeedsMenuState" hidden="true"/>
+    <broadcaster id="tabviewGroupsNumber" groups="0"/>
+#ifdef MOZ_SERVICES_SYNC
+    <broadcaster id="sync-setup-state"/>
+    <broadcaster id="sync-syncnow-state"/>
+#endif
+    <broadcaster id="workOfflineMenuitemState"/>
   </broadcasterset>
 
   <keyset id="mainKeyset">
     <key id="key_newNavigator"
          key="&newNavigatorCmd.key;"
          command="cmd_newNavigator"
          modifiers="accel"/>
     <key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel" command="cmd_newNavigatorTab"/>
@@ -206,34 +213,31 @@
          modifiers="alt"/>
 #endif
 
 #
 # Search Command Key Logic works like this:
 # 
 # Unix: Ctrl+K (cross platform binding)
 #       Ctrl+J (in case of emacs Ctrl-K conflict)
-# Mac:  Ctrl+K (cross platform binding)
+# Mac:  Cmd+K (cross platform binding)
+#       Cmd+Opt+F (platform convention)
 # Win:  Ctrl+K (cross platform binding)
-#       Ctrl+E (IE compat)
 #
 # We support Ctrl+K on all platforms now and advertise it in the menu since it is
 # our standard - it is a "safe" choice since it is near no harmful keys like "W" as
 # "E" is. People mourning the loss of Ctrl+K for emacs compat can switch their GTK
 # system setting to use emacs emulation, and we should respect it. Focus-Search-Box
 # is a fundamental keybinding and we are maintaining a XP binding so that it is easy
 # for people to switch to Linux.
 #
     <key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
 #ifdef XP_MACOSX
     <key id="key_search2" key="&findOnCmd.commandkey;" command="Tools:Search" modifiers="accel,alt"/>
 #endif
-#ifdef XP_WIN
-    <key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
-#endif
 #ifdef XP_GNOME
     <key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
     <key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
 #else
     <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
 #endif
     <key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
     <key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift" disabled="true"/>
@@ -338,16 +342,18 @@
     <key                          key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
     <key id="key_fullZoomReset"   key="&fullZoomResetCmd.commandkey;"    command="cmd_fullZoomReset"   modifiers="accel"/>
     <key                          key="&fullZoomResetCmd.commandkey2;"   command="cmd_fullZoomReset"   modifiers="accel"/>
 
     <key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
 
     <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
 
+    <key id="key_tabview" key="&tabView.commandkey;" command="Browser:ToggleTabView" modifiers="accel"/>
+
     <key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
     <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
 #ifdef XP_MACOSX
     <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
 #endif
 #ifdef XP_UNIX
     <key id="key_quitApplication" key="&quitApplicationCmdMac.key;" command="cmd_quitApplication" modifiers="accel"/>
 #endif
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -17,16 +17,17 @@
 # Portions created by the Initial Developer are Copyright (C) 2007
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #  Dan Mills <thunder@mozilla.com>
 #  Chris Beard <cbeard@mozilla.com>
 #  Dan Mosedale <dmose@mozilla.org>
 #  Paul O’Shannessy <paul@oshannessy.com>
+#  Philipp von Weitershausen <philipp@weitershausen.de>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -51,43 +52,63 @@ let gSyncUI = {
       Services.obs.removeObserver(gSyncUI, "weave:service:ready");
     }, false);
   },
   initUI: function SUI_initUI() {
     let obs = ["weave:service:sync:start",
                "weave:service:sync:finish",
                "weave:service:sync:error",
                "weave:service:sync:delayed",
+               "weave:service:quota:remaining",
                "weave:service:setup-complete",
                "weave:service:login:start",
                "weave:service:login:finish",
                "weave:service:login:error",
                "weave:service:logout:finish",
                "weave:service:start-over"];
 
     // If this is a browser window?
     if (gBrowser) {
-      obs.push("weave:notification:added", "weave:notification:removed");
+      obs.push("weave:notification:added");
     }
 
     let self = this;
     obs.forEach(function(topic) {
       Services.obs.addObserver(self, topic, true);
     });
 
     // Find the alltabs-popup, only if there is a gBrowser
     if (gBrowser) {
       let popup = document.getElementById("alltabs-popup");
       let self = this;
       popup.addEventListener("popupshowing", function() {
         self.alltabsPopupShowing();
       }, true);
+
+      if (Weave.Notifications.notifications.length)
+        this.initNotifications();
     }
     this.updateUI();
   },
+  
+  initNotifications: function SUI_initNotifications() {
+    const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+    let notificationbox = document.createElementNS(XULNS, "notificationbox");
+    notificationbox.id = "sync-notifications";
+    notificationbox.setAttribute("flex", "1");
+
+    let bottombox = document.getElementById("browser-bottombox");
+    bottombox.insertBefore(notificationbox, bottombox.firstChild);
+
+    // Force a style flush to ensure that our binding is attached.
+    notificationbox.clientTop;
+
+    // notificationbox will listen to observers from now on.
+    Services.obs.removeObserver(this, "weave:notification:added");
+  },
 
   _wasDelayed: false,
 
   _needsSetup: function SUI__needsSetup() {
     let firstSync = "";
     try {
       firstSync = Services.prefs.getCharPref("services.sync.firstSync");
     } catch (e) { }
@@ -98,32 +119,30 @@ let gSyncUI = {
   _isLoggedIn: function() {
     if (this._needsSetup())
       return false;
     return Weave.Service.isLoggedIn;
   },
 
   updateUI: function SUI_updateUI() {
     let needsSetup = this._needsSetup();
-    document.getElementById("sync-setup").hidden = !needsSetup;
-    document.getElementById("sync-menu").hidden = needsSetup;
+    document.getElementById("sync-setup-state").hidden = !needsSetup;
+    document.getElementById("sync-syncnow-state").hidden = needsSetup;
+
+    if (!gBrowser)
+      return;
 
-    if (gBrowser) {
-      let showLabel = !this._isLoggedIn() && !needsSetup;
-      let button = document.getElementById("sync-status-button");
-      button.setAttribute("class", showLabel ? "statusbarpanel-iconic-text"
-                                             : "statusbarpanel-iconic");
-      button.image = "chrome://browser/skin/sync-16.png";
+    let button = document.getElementById("sync-button");
+    if (!button)
+      return;
 
-      if (!this._isLoggedIn()) {
-        //XXXzpao When we move the string bundle, we can add more and make this
-        //        say "needs setup" or something similar. (bug 583381)
-        button.removeAttribute("tooltiptext");
-      }
-    }
+    button.removeAttribute("status");
+    this._updateLastSyncTime();
+    if (needsSetup)
+      button.removeAttribute("tooltiptext");
   },
 
   alltabsPopupShowing: function(event) {
     // Should we show the menu item?
     if (!Weave.Service.isLoggedIn || !Weave.Engines.get("tabs").enabled)
       return;
 
     let label = this._stringBundle.GetStringFromName("tabs.fromOtherComputers.label");
@@ -135,57 +154,67 @@ let gSyncUI = {
     menuitem.setAttribute("class", "alltabs-item");
     menuitem.setAttribute("oncommand", "BrowserOpenSyncTabs();");
 
     let sep = document.createElement("menuseparator");
     sep.setAttribute("id", "sync-tabs-sep");
 
     // Fake the tab object on the menu entries, so that we don't have to worry
     // about removing them ourselves. They will just get cleaned up by popup
-    // binding. This also makes sure the statusbar updates with the URL.
+    // binding.
     menuitem.tab = { "linkedBrowser": { "currentURI": { "spec": label } } };
     sep.tab = { "linkedBrowser": { "currentURI": { "spec": " " } } };
 
     popup.insertBefore(sep, popup.firstChild);
     popup.insertBefore(menuitem, sep);
   },
 
 
   // Functions called by observers
   onActivityStart: function SUI_onActivityStart() {
-    //XXXzpao Followup: Do this with a class. (bug 583384)
-    if (gBrowser)
-      document.getElementById("sync-status-button").image =
-        "chrome://browser/skin/sync-16-throbber.png";
+    if (!gBrowser)
+      return;
+
+    let button = document.getElementById("sync-button");
+    if (!button)
+      return;
+
+    button.setAttribute("status", "active");
   },
 
   onSyncFinish: function SUI_onSyncFinish() {
     this._onSyncEnd(true);
   },
 
   onSyncError: function SUI_onSyncError() {
     this._onSyncEnd(false);
   },
 
   onSyncDelay: function SUI_onSyncDelay() {
     // basically, we want to just inform users that stuff is going to take a while
     let title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title");
     let description = this._stringBundle.GetStringFromName("error.sync.no_node_found");
-    let notification = new Weave.Notification(title, description, null, Weave.Notifications.PRIORITY_INFO);
+    let buttons = [new Weave.NotificationButton(
+      this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
+      this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
+      function() { gWeaveWin.openServerStatus(); return true; }
+    )];
+    let notification = new Weave.Notification(
+      title, description, null, Weave.Notifications.PRIORITY_INFO, buttons);
     Weave.Notifications.replaceTitle(notification);
     this._wasDelayed = true;
   },
 
   onLoginFinish: function SUI_onLoginFinish() {
     // Clear out any login failure notifications
     let title = this._stringBundle.GetStringFromName("error.login.title");
     Weave.Notifications.removeAll(title);
 
     this.updateUI();
-    this._updateLastSyncItem();
+    this._updateLastSyncTime();
   },
 
   onLoginError: function SUI_onLoginError() {
     // if login fails, any other notifications are essentially moot
     Weave.Notifications.removeAll();
 
     // if we haven't set up the client, don't show errors
     if (this._needsSetup()) {
@@ -213,151 +242,159 @@ let gSyncUI = {
   onLogout: function SUI_onLogout() {
     this.updateUI();
   },
 
   onStartOver: function SUI_onStartOver() {
     this.updateUI();
   },
 
-  onNotificationAdded: function SUI_onNotificationAdded() {
-    if (!gBrowser)
-      return;
+  onQuotaNotice: function onQuotaNotice(subject, data) {
+    let title = this._stringBundle.GetStringFromName("warning.sync.quota.label");
+    let description = this._stringBundle.GetStringFromName("warning.sync.quota.description");
+    let buttons = [];
+    buttons.push(new Weave.NotificationButton(
+      this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"),
+      this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"),
+      function() { gSyncUI.openQuotaDialog(); return true; }
+    ));
 
-    let notificationsButton = document.getElementById("sync-notifications-button");
-    notificationsButton.hidden = false;
-    let notification = Weave.Notifications.notifications.reduce(function(prev, cur) {
-      return prev.priority > cur.priority ? prev : cur;
-    });
-
-    let image = notification.priority >= Weave.Notifications.PRIORITY_WARNING ?
-                "chrome://global/skin/icons/warning-16.png" :
-                "chrome://global/skin/icons/information-16.png";
-    notificationsButton.image = image;
-    notificationsButton.label = notification.title;
+    let notification = new Weave.Notification(
+      title, description, null, Weave.Notifications.PRIORITY_WARNING, buttons);
+    Weave.Notifications.replaceTitle(notification);
   },
 
-  onNotificationRemoved: function SUI_onNotificationRemoved() {
-    if (!gBrowser)
-      return;
-
-    if (Weave.Notifications.notifications.length == 0) {
-      document.getElementById("sync-notifications-button").hidden = true;
-    }
-    else {
-      // Display remaining notifications
-      this.onNotificationAdded();
-    }
+  openServerStatus: function () {
+    let statusURL = Services.prefs.getCharPref("services.sync.statusURL");
+    window.openUILinkIn(statusURL, "tab");
   },
 
   // Commands
-  doUpdateMenu: function SUI_doUpdateMenu(event) {
-    this._updateLastSyncItem();
-
-    let loginItem = document.getElementById("sync-loginitem");
-    let logoutItem = document.getElementById("sync-logoutitem");
-    let syncItem = document.getElementById("sync-syncnowitem");
-
-    // Don't allow "login" to be selected in some cases
-    let offline = Services.io.offline;
-    let locked = Weave.Service.locked;
-    let noUser = Weave.Service.username == "";
-    let notReady = offline || locked || noUser;
-    loginItem.setAttribute("disabled", notReady);
-    logoutItem.setAttribute("disabled", notReady);
-
-    // Don't allow "sync now" to be selected in some cases
-    let loggedIn = Weave.Service.isLoggedIn;
-    let noNode = Weave.Status.sync == Weave.NO_SYNC_NODE_FOUND;
-    let disableSync = notReady || !loggedIn || noNode;
-    syncItem.setAttribute("disabled", disableSync);
-
-    // Only show one of login/logout
-    loginItem.setAttribute("hidden", loggedIn);
-    logoutItem.setAttribute("hidden", !loggedIn);
-  },
-
   doLogin: function SUI_doLogin() {
     Weave.Service.login();
   },
 
   doLogout: function SUI_doLogout() {
     Weave.Service.logout();
   },
 
   doSync: function SUI_doSync() {
-    Weave.Service.sync();
+    if (Weave.Service.isLoggedIn || Weave.Service.login())
+      Weave.Service.sync();
   },
 
-  handleStatusbarButton: function SUI_handleStatusbarButton() {
-    if (Weave.Service.isLoggedIn)
-      Weave.Service.sync();
-    else if (this._needsSetup())
+  handleToolbarButton: function SUI_handleStatusbarButton() {
+    if (this._needsSetup())
       this.openSetup();
     else
-      Weave.Service.login();
+      this.doSync();
   },
 
   //XXXzpao should be part of syncCommon.js - which we might want to make a module...
   //        To be fixed in a followup (bug 583366)
   openSetup: function SUI_openSetup() {
     let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
     if (win)
       win.focus();
     else {
       window.openDialog("chrome://browser/content/syncSetup.xul",
                         "weaveSetup", "centerscreen,chrome,resizable=no");
     }
   },
 
+  openQuotaDialog: function SUI_openQuotaDialog() {
+    let win = Services.wm.getMostRecentWindow("Sync:ViewQuota");
+    if (win)
+      win.focus();
+    else 
+      Services.ww.activeWindow.openDialog(
+        "chrome://browser/content/syncQuota.xul", "",
+        "centerscreen,chrome,dialog,modal");
+  },
+
   openPrefs: function SUI_openPrefs() {
     openPreferences("paneSync");
   },
 
 
   // Helpers
-  _updateLastSyncItem: function SUI__updateLastSyncItem() {
+  _updateLastSyncTime: function SUI__updateLastSyncTime() {
+    if (!gBrowser)
+      return;
+
+    let syncButton = document.getElementById("sync-button");
+    if (!syncButton)
+      return;
+
     let lastSync;
     try {
       lastSync = Services.prefs.getCharPref("services.sync.lastSync");
     }
     catch (e) { };
-    if (!lastSync)
+    if (!lastSync || this._needsSetup()) {
+      syncButton.removeAttribute("tooltiptext");
       return;
-
-    let lastSyncItem = document.getElementById("sync-lastsyncitem");
+    }
 
     // Show the day-of-week and time (HH:MM) of last sync
     let lastSyncDate = new Date(lastSync).toLocaleFormat("%a %H:%M");
     let lastSyncLabel =
       this._stringBundle.formatStringFromName("lastSync.label", [lastSyncDate], 1);
-    lastSyncItem.setAttribute("label", lastSyncLabel);
-    lastSyncItem.setAttribute("hidden", "false");
-    document.getElementById("sync-lastsyncsep").hidden = false;
 
-    if (gBrowser)
-      document.getElementById("sync-status-button").
-               setAttribute("tooltiptext", lastSyncLabel);
+    syncButton.setAttribute("tooltiptext", lastSyncLabel);
   },
 
   _onSyncEnd: function SUI__onSyncEnd(success) {
     let title = this._stringBundle.GetStringFromName("error.sync.title");
     if (!success) {
       if (Weave.Status.login != Weave.LOGIN_SUCCEEDED) {
         this.onLoginError();
         return;
       }
       let error = Weave.Utils.getErrorString(Weave.Status.sync);
       let description =
         this._stringBundle.formatStringFromName("error.sync.description", [error], 1);
 
       let priority = Weave.Notifications.PRIORITY_WARNING;
       let buttons = [];
 
-      if (!Weave.Status.enforceBackoff) {
+      // Check if the client is outdated in some way
+      let outdated = Weave.Status.sync == Weave.VERSION_OUT_OF_DATE;
+      for (let [engine, reason] in Iterator(Weave.Status.engines))
+        outdated = outdated || reason == Weave.VERSION_OUT_OF_DATE;
+
+      if (outdated) {
+        description = this._stringBundle.GetStringFromName(
+          "error.sync.needUpdate.description");
+        buttons.push(new Weave.NotificationButton(
+          this._stringBundle.GetStringFromName("error.sync.needUpdate.label"),
+          this._stringBundle.GetStringFromName("error.sync.needUpdate.accesskey"),
+          function() { window.openUILinkIn("https://services.mozilla.com/update/", "tab"); return true; }
+        ));
+      }
+      else if (Weave.Status.sync == Weave.OVER_QUOTA) {
+        description = this._stringBundle.GetStringFromName(
+          "error.sync.quota.description");
+        buttons.push(new Weave.NotificationButton(
+          this._stringBundle.GetStringFromName(
+            "error.sync.viewQuotaButton.label"),
+          this._stringBundle.GetStringFromName(
+            "error.sync.viewQuotaButton.accesskey"),
+          function() { gSyncUI.openQuotaDialog(); return true; } )
+        );
+      }
+      else if (Weave.Status.enforceBackoff) {
+        priority = Weave.Notifications.PRIORITY_INFO;
+        buttons.push(new Weave.NotificationButton(
+          this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
+          this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
+          function() { gSyncUI.openServerStatus(); return true; }
+        ));
+      }
+      else {
         priority = Weave.Notifications.PRIORITY_INFO;
         buttons.push(new Weave.NotificationButton(
           this._stringBundle.GetStringFromName("error.sync.tryAgainButton.label"),
           this._stringBundle.GetStringFromName("error.sync.tryAgainButton.accesskey"),
           function() { gSyncUI.doSync(); return true; }
         ));
       }
 
@@ -372,33 +409,36 @@ let gSyncUI = {
 
     if (this._wasDelayed && Weave.Status.sync != Weave.NO_SYNC_NODE_FOUND) {
       title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title");
       Weave.Notifications.removeAll(title);
       this._wasDelayed = false;
     }
 
     this.updateUI();
-    this._updateLastSyncItem();
+    this._updateLastSyncTime();
   },
   
   observe: function SUI_observe(subject, topic, data) {
     switch (topic) {
       case "weave:service:sync:start":
         this.onActivityStart();
         break;
       case "weave:service:sync:finish":
         this.onSyncFinish();
         break;
       case "weave:service:sync:error":
         this.onSyncError();
         break;
       case "weave:service:sync:delayed":
         this.onSyncDelay();
         break;
+      case "weave:service:quota:remaining":
+        this.onQuotaNotice();
+        break;
       case "weave:service:setup-complete":
         this.onLoginFinish();
         break;
       case "weave:service:login:start":
         this.onActivityStart();
         break;
       case "weave:service:login:finish":
         this.onLoginFinish();
@@ -411,20 +451,17 @@ let gSyncUI = {
         break;
       case "weave:service:start-over":
         this.onStartOver();
         break;
       case "weave:service:ready":
         this.initUI();
         break;
       case "weave:notification:added":
-        this.onNotificationAdded();
-        break;
-      case "weave:notification:removed":
-        this.onNotificationRemoved();
+        this.initNotifications();
         break;
     }
   },
 
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsIObserver,
     Ci.nsISupportsWeakReference
   ])
--- a/browser/base/content/browser-tabview.js
+++ b/browser/base/content/browser-tabview.js
@@ -96,16 +96,21 @@ let TabView = {
           let data = (self.isVisible() ? "true" : "false");
           self._sessionstore.setWindowValue(window, self._visibilityID, data);
         }
       }
       
       Services.obs.addObserver(observer, "quit-application-requested", false);
     }
   },
+  
+  // ----------
+  getContentWindow: function TabView_getContentWindow() {
+    return this._window;
+  },
 
   // ----------
   isVisible: function() {
     return (this._deck ? this._deck.selectedIndex == 1 : false);
   },
 
   // ----------
   show: function() {
@@ -131,32 +136,49 @@ let TabView = {
 
   // ----------
   toggle: function() {
     if (this.isVisible())
       this.hide();
     else 
       this.show();
   },
+  
+  getActiveGroupName: function Tabview_getActiveGroupName() {
+    // We get the active group this way, instead of querying
+    // GroupItems.getActiveGroupItem() because the tabSelect event
+    // will not have happened by the time the browser tries to
+    // update the title.
+    let activeTab = window.gBrowser.selectedTab;
+    if (activeTab.tabItem && activeTab.tabItem.parent){
+      let groupName = activeTab.tabItem.parent.getTitle();
+      if (groupName)
+        return groupName;
+    }
+    return null;
+  },  
 
   // ----------
   updateContextMenu: function(tab, popup) {
     let separator = document.getElementById("context_tabViewNamedGroups");
     let isEmpty = true;
 
     while (popup.firstChild && popup.firstChild != separator)
       popup.removeChild(popup.firstChild);
 
     let self = this;
     this._initFrame(function() {
       let activeGroup = tab.tabItem.parent;
       let groupItems = self._window.GroupItems.groupItems;
 
-      groupItems.forEach(function(groupItem) { 
-        if (groupItem.getTitle().length > 0 && 
+      groupItems.forEach(function(groupItem) {
+        // if group has title, it's not hidden and there is no active group or
+        // the active group id doesn't match the group id, a group menu item
+        // would be added.
+        if (groupItem.getTitle().length > 0 && !groupItem.hidden &&
             (!activeGroup || activeGroup.id != groupItem.id)) {
           let menuItem = self._createGroupMenuItem(groupItem);
           popup.insertBefore(menuItem, separator);
           isEmpty = false;
         }
       });
       separator.hidden = isEmpty;
     });
@@ -185,57 +207,16 @@ let TabView = {
   _setBrowserKeyHandlers : function() {
     let self = this;
 
     window.addEventListener("keypress", function(event) {
       if (self.isVisible())
         return;
 
       let charCode = event.charCode;
-#ifdef XP_MACOSX
-      // if a text box in a webpage has the focus, the event.altKey would
-      // return false so we are depending on the charCode here.
-      if (!event.ctrlKey && !event.metaKey && !event.shiftKey &&
-          charCode == 160) { // alt + space
-#else
-      if (event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey && 
-          charCode == KeyEvent.DOM_VK_SPACE) { // ctrl + space
-#endif
-
-        // Don't handle this event if it's coming from a node that might allow
-        // multiple keyboard selection like selects or trees
-        let node = event.target;
-        switch (node.namespaceURI) {
-          case "http://www.w3.org/1999/xhtml":
-            // xhtml:select only allows multiple when the attr is set
-            if (node.localName == "select" && node.hasAttribute("multiple"))
-              return;
-            break;
-
-          case "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":
-            switch (node.localName) {
-              case "listbox":
-                // xul:listbox is by default single
-                if (node.getAttribute("seltype") == "multiple")
-                  return;
-                break;
-              case "tree":
-                // xul:tree is by default multiple
-                if (node.getAttribute("seltype") != "single")
-                  return;
-                break;
-            }
-        }
-
-        event.stopPropagation();
-        event.preventDefault();
-        self.show();
-        return;
-      }
-
       // Control (+ Shift) + `
       if (event.ctrlKey && !event.metaKey && !event.altKey &&
           (charCode == 96 || charCode == 126)) {
         event.stopPropagation();
         event.preventDefault();
 
         self._initFrame(function() {
           let tabItem = self._window.GroupItems.getNextGroupItemTab(event.shiftKey);
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -32,41 +32,35 @@ tabbrowser {
   -moz-transition: min-width .2s ease-out, max-width .25s ease-out;
 }
 
 .tabbrowser-tab:not([pinned]):not([fadein]) {
   max-width: 1px;
   min-width: 1px;
 }
 
-.tabbrowser-tab:not([fadein]):not([pinned]) > .tab-text,
-.tabbrowser-tab:not([fadein]):not([pinned]) > .tab-icon-image,
-.tabbrowser-tab:not([fadein]):not([pinned]) > .tab-close-button {
+.tab-progress:not([fadein]):not([pinned]),
+.tab-label:not([fadein]):not([pinned]),
+.tab-icon-image:not([fadein]):not([pinned]),
+.tab-close-button:not([fadein]):not([pinned]) {
   opacity: 0 !important;
 }
 
-.tabbrowser-tab > .tab-text,
-.tabbrowser-tab > .tab-icon-image,
-.tabbrowser-tab > .tab-close-button {
+.tab-progress,
+.tab-label,
+.tab-icon-image,
+.tab-close-button {
   -moz-transition: opacity .25s;
 }
 
 .tabbrowser-tab[pinned] {
   position: fixed;
   display: block; /* position:fixed already does this (bug 579776), but let's be explicit */
 }
 
-.tabbrowser-tab[pinned] > .tab-text {
-  display: none;
-}
-
-.tabbrowser-tab[pinned] > .tab-icon-image {
-  vertical-align: middle;
-}
-
 #alltabs-popup {
   -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-alltabs-popup");
 }
 
 toolbar[printpreview="true"] {
   -moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
 }
 
@@ -138,31 +132,92 @@ toolbar[mode="icons"] > #reload-button[d
 }
 
 .menuitem-iconic-tooltip,
 .menuitem-tooltip[type="checkbox"],
 .menuitem-tooltip[type="radio"] {
   -moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-iconic-tooltip");
 }
 
+#appmenu_offlineModeRecovery:not([checked=true]) {
+  display: none;
+}
+
 /* ::::: location bar ::::: */
 #urlbar {
   -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
 }
 
+#urlbar-progress {
+  -moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter");
+}
+
 /* Some child nodes want to be ordered based on the locale's direction, while
    everything else should be ltr. */
-#urlbar:-moz-locale-dir(rtl) > .autocomplete-textbox-container > .textbox-input-box {
+#urlbar-progress:-moz-locale-dir(rtl),
+.urlbar-input-box:-moz-locale-dir(rtl) {
   direction: rtl;
 }
 
-#urlbar html|*.autocomplete-textbox {
+html|*.urlbar-input {
   direction: ltr;
 }
 
+/* over-link in location bar */
+
+/* Delay transitions on mouseout.  (Mouseover transitions are delayed by a
+   timeout in urlbarBindings.xml.) */
+.urlbar-textbox-container:not([overlinkstate]),
+.urlbar-over-link-layer:not([overlinkstate]),
+.urlbar-textbox-container-children:not([overlinkstate]),
+.urlbar-over-link-box:not([overlinkstate]) {
+  -moz-transition-delay: 100ms;
+}
+
+.urlbar-over-link-layer[overlinkstate="fade-in"],
+.urlbar-textbox-container:not([overlinkstate]) {
+  -moz-transition-property: color;
+  -moz-transition-duration: 150ms;
+  -moz-transition-timing-function: cubic-bezier(0.0, 0.6, 1.0, 1.0);
+}
+
+.urlbar-textbox-container[overlinkstate="fade-in"],
+.urlbar-over-link-layer:not([overlinkstate]) {
+  -moz-transition-property: color;
+  -moz-transition-duration: 150ms;
+  -moz-transition-timing-function: linear;
+  color: transparent;
+}
+
+.urlbar-over-link-box[overlinkstate="fade-in"],
+.urlbar-textbox-container-children:not([overlinkstate]) {
+  -moz-transition-property: opacity;
+  -moz-transition-duration: 150ms;
+  opacity: 1;
+}
+
+.urlbar-textbox-container-children[overlinkstate="fade-in"],
+.urlbar-over-link-box:not([overlinkstate]) {
+  -moz-transition-property: opacity;
+  -moz-transition-duration: 150ms;
+  opacity: 0;
+}
+
+.urlbar-textbox-container[overlinkstate="showing"] {
+  color: transparent;
+}
+
+.urlbar-over-link-box[overlinkstate="showing"] {
+  opacity: 1;
+}
+
+.urlbar-textbox-container-children[overlinkstate="showing"] {
+  opacity: 0;
+}
+
 /* For results that are actions, their description text is shown instead of
    the URL - this needs to follow the locale's direction, unlike URLs. */
 richlistitem[type~="action"]:-moz-locale-dir(rtl) > .ac-url-box {
   direction: rtl;
 }
 
 #urlbar:not([actiontype]) > #urlbar-display {
   display: none;
@@ -181,25 +236,16 @@ richlistitem[type~="action"]:-moz-locale
   -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup");
 }
 
 #urlbar-throbber:not([busy="true"]),
 #urlbar-throbber[busy="true"] + #page-proxy-favicon {
   display: none;
 }
 
-#feed-button > .button-box > .box-inherit > .button-text,
-#feed-button > .button-box > .button-menu-dropmarker {
-  display: none;
-}
-
-#feed-menu > .feed-menuitem:-moz-locale-dir(rtl) {
-  direction: rtl;
-}
-
 #urlbar-container[combined] > #urlbar > #urlbar-icons > #go-button,
 #urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon:not(#go-button),
 #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button,
 #urlbar[pageproxystate="invalid"][focused="true"] > #urlbar-go-button ~ toolbarbutton,
 #urlbar[pageproxystate="valid"] > #urlbar-go-button,
 #urlbar:not([focused="true"]) > #urlbar-go-button {
   visibility: collapse;
 }
@@ -272,23 +318,24 @@ window[chromehidden~="toolbar"] toolbar:
 }
 
 #navigator-toolbox ,
 #status-bar ,
 #mainPopupSet {
   min-width: 1px;
 }
 
-/* Sync statusbar UI */
 %ifdef MOZ_SERVICES_SYNC
-#sync-notifications-box {
+/* Sync notification UI */
+#sync-notifications {
   -moz-binding: url("chrome://browser/content/syncNotification.xml#notificationbox");
+  overflow-y: visible !important;
 }
 
-#sync-notifications-box notification {
+#sync-notifications notification {
   -moz-binding: url("chrome://browser/content/syncNotification.xml#notification");
 }
 %endif
 
 /* Identity UI */
 #identity-popup-content-box.unknownIdentity > #identity-popup-connectedToLabel ,
 #identity-popup-content-box.unknownIdentity > #identity-popup-runByLabel ,
 #identity-popup-content-box.unknownIdentity > #identity-popup-content-host ,
@@ -367,11 +414,26 @@ window[chromehidden~="toolbar"] toolbar:
 
 #notification-popup-box[anchorid="geo-notification-icon"] > #geo-notification-icon,
 #notification-popup-box[anchorid="indexedDB-notification-icon"] > #indexedDB-notification-icon,
 #notification-popup-box[anchorid="addons-notification-icon"] > #addons-notification-icon,
 #notification-popup-box[anchorid="password-notification-icon"] > #password-notification-icon {
   display: -moz-box;
 }
 
+#invalid-form-popup {
+  max-width: 280px;
+}
+
 #geolocation-notification {
   -moz-binding: url("chrome://browser/content/urlbarBindings.xml#geolocation-notification");
 }
+
+/* override hidden="true" for the status bar compatibility shim
+   in case it was persisted for the real status bar */
+#status-bar {
+  display: -moz-box;
+}
+
+/* Remove the resizer from the statusbar compatibility shim */
+#status-bar > .statusbar-resizerpanel {
+  display: none;
+}
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -47,16 +47,18 @@
 #   Edward Lee <edward.lee@engineering.uiuc.edu>
 #   Paul O’Shannessy <paul@oshannessy.com>
 #   Nils Maier <maierman@web.de>
 #   Rob Arnold <robarnold@cmu.edu>
 #   Dietrich Ayala <dietrich@mozilla.com>
 #   Gavin Sharp <gavin@gavinsharp.com>
 #   Justin Dolske <dolske@mozilla.com>
 #   Rob Campbell <rcampbell@mozilla.com>
+#   David Dahl <ddahl@mozilla.com>
+#   Patrick Walton <pcwalton@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -368,34 +370,24 @@ function findChildShell(aDocument, aDocS
     docShell = findChildShell(aDocument, docShell, aSoughtURI);
     if (docShell)
       return docShell;
   }
   return null;
 }
 
 const gPopupBlockerObserver = {
-  _reportButton: null,
 
   onUpdatePageReport: function (aEvent)
   {
     if (aEvent.originalTarget != gBrowser.selectedBrowser)
       return;
 
-    if (!this._reportButton)
-      this._reportButton = document.getElementById("page-report-button");
-
-    if (!gBrowser.pageReport) {
-      // Hide the popup blocker statusbar button
-      this._reportButton.hidden = true;
-
+    if (!gBrowser.pageReport)
       return;
-    }
-
-    this._reportButton.hidden = false;
 
     // Only show the notification again if we've not already shown it. Since
     // notifications are per-browser, we don't need to worry about re-adding
     // it.
     if (!gBrowser.pageReport.reported) {
       if (gPrefService.getBoolPref("privacy.popups.showBrowserMessage")) {
         var brandBundle = document.getElementById("bundle_brand");
         var brandShortName = brandBundle.getString("brandShortName");
@@ -543,20 +535,17 @@ const gPopupBlockerObserver = {
     if (foundUsablePopupURI)
       blockedPopupsSeparator.removeAttribute("hidden");
     else
       blockedPopupsSeparator.setAttribute("hidden", true);
 
     var blockedPopupDontShowMessage = document.getElementById("blockedPopupDontShowMessage");
     var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
     blockedPopupDontShowMessage.setAttribute("checked", !showMessage);
-    if (aEvent.target.localName == "popup")
-      blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
-    else
-      blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromStatusbar"));
+    blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
   },
 
   showBlockedPopup: function (aEvent)
   {
     var target = aEvent.target;
     var popupWindowURI = target.getAttribute("popupWindowURI");
     var features = target.getAttribute("popupWindowFeatures");
     var name = target.getAttribute("popupWindowName");
@@ -593,26 +582,29 @@ const gPopupBlockerObserver = {
     }
     else
       window.openDialog("chrome://browser/content/preferences/permissions.xul",
                         "_blank", "resizable,dialog=no,centerscreen", params);
   },
 
   dontShowMessage: function ()
   {
+#if 0 
+    // Disabled until bug 594294 is fixed.
     var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
     var firstTime = gPrefService.getBoolPref("privacy.popups.firstTime");
 
     // If the info message is showing at the top of the window, and the user has never
     // hidden the message before, show an info box telling the user where the info
     // will be displayed.
     if (showMessage && firstTime)
       this._displayPageReportFirstTime();
 
     gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
+#endif
 
     gBrowser.getNotificationBox().removeCurrentNotification();
   },
 
   _displayPageReportFirstTime: function ()
   {
     window.openDialog("chrome://browser/content/pageReportFirstTime.xul", "_blank",
                       "dependent");
@@ -784,16 +776,82 @@ const gXPInstallObserver = {
 
       PopupNotifications.show(browser, notificationID, messageString, anchorID,
                               action, null, options);
       break;
     }
   }
 };
 
+const gFormSubmitObserver = {
+  QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]),
+
+  panel: null,
+
+  init: function()
+  {
+    this.panel = document.getElementById('invalid-form-popup');
+    this.panel.appendChild(document.createTextNode(""));
+  },
+
+  panelIsOpen: function()
+  {
+    return this.panel && this.panel.state != "hiding" &&
+           this.panel.state != "closed";
+  },
+
+  notifyInvalidSubmit : function (aFormElement, aInvalidElements)
+  {
+    // We are going to handle invalid form submission attempt by focusing the
+    // first invalid element and show the corresponding validation message in a
+    // panel attached to the element.
+    if (!aInvalidElements.length) {
+      return;
+    }
+
+    // Don't show the popup if the current tab doesn't contain the invalid form.
+    if (gBrowser.contentDocument !=
+        aFormElement.ownerDocument.defaultView.top.document) {
+      return;
+    }
+
+    let element = aInvalidElements.queryElementAt(0, Ci.nsISupports);
+
+    if (!(element instanceof HTMLInputElement ||
+          element instanceof HTMLTextAreaElement ||
+          element instanceof HTMLSelectElement ||
+          element instanceof HTMLButtonElement)) {
+      return;
+    }
+
+    // Limit the message to 256 characters.
+    this.panel.firstChild.nodeValue = element.validationMessage.substring(0, 256);
+
+    element.focus();
+
+    // If the user type something or blur the element, we want to remove the popup.
+    // We could check for clicks but a click is already removing the popup.
+    let eventHandler = function(e) {
+      gFormSubmitObserver.panel.hidePopup();
+    };
+    element.addEventListener("input", eventHandler, false);
+    element.addEventListener("blur", eventHandler, false);
+
+    // One event to bring them all and in the darkness bind them all.
+    this.panel.addEventListener("popuphiding", function(aEvent) {
+      aEvent.target.removeEventListener("popuphiding", arguments.callee, false);
+      element.removeEventListener("input", eventHandler, false);
+      element.removeEventListener("blur", eventHandler, false);
+    }, false);
+
+    this.panel.hidden = false;
+    this.panel.openPopup(element, "after_start", 0, 0);
+  }
+};
+
 // Simple gestures support
 //
 // As per bug #412486, web content must not be allowed to receive any
 // simple gesture events.  Multi-touch gesture APIs are in their
 // infancy and we do NOT want to be forced into supporting an API that
 // will probably have to change in the future.  (The current Mac OS X
 // API is undocumented and was reverse-engineered.)  Until support is
 // implemented in the event dispatcher to keep these events as
@@ -1313,20 +1371,22 @@ function prepareForStartup() {
   gGestureSupport.init(true);
 }
 
 function delayedStartup(isLoadingBlank, mustLoadSidebar) {
   Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false);
   Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked", false);
   Services.obs.addObserver(gXPInstallObserver, "addon-install-failed", false);
   Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
+  Services.obs.addObserver(gFormSubmitObserver, "invalidformsubmit", false);
 
   BrowserOffline.init();
   OfflineApps.init();
   IndexedDBPromptHelper.init();
+  gFormSubmitObserver.init();
 
   gBrowser.addEventListener("pageshow", function(evt) { setTimeout(pageShowEventHandlers, 0, evt); }, true);
 
   // Ensure login manager is up and running.
   Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
 
   if (mustLoadSidebar) {
     let sidebar = document.getElementById("sidebar");
@@ -1463,19 +1523,16 @@ function delayedStartup(isLoadingBlank, 
   // auto-resume downloads begin (such as after crashing or quitting with
   // active downloads) and speeds up the first-load of the download manager UI.
   // If the user manually opens the download manager before the timeout, the
   // downloads will start right away, and getting the service again won't hurt.
   setTimeout(function() {
     gDownloadMgr = Cc["@mozilla.org/download-manager;1"].
                    getService(Ci.nsIDownloadManager);
 
-    // Initialize the downloads monitor panel listener
-    DownloadMonitorPanel.init();
-
     if (Win7Features) {
       let tempScope = {};
       Cu.import("resource://gre/modules/DownloadTaskbarProgress.jsm",
                 tempScope);
       tempScope.DownloadTaskbarProgress.onBrowserWindowLoad(window);
     }
   }, 10000);
 
@@ -1523,17 +1580,29 @@ function delayedStartup(isLoadingBlank, 
     if (appMenuInspect)
       appMenuInspect.setAttribute("hidden", false);
   }
 
   // Enable Error Console?
   let consoleEnabled = gPrefService.getBoolPref("devtools.errorconsole.enabled");
   if (consoleEnabled) {
     document.getElementById("javascriptConsole").hidden = false;
-    document.getElementById("key_errorConsole").disabled = false;
+    document.getElementById("key_errorConsole").removeAttribute("disabled");
+  }
+
+  // If the user (or the locale) hasn't enabled the top-level "Character
+  // Encoding" menu via the "browser.menu.showCharacterEncoding" preference,
+  // hide it.
+  const showCharacterEncodingPref = "browser.menu.showCharacterEncoding";
+  let extraCharacterEncodingMenuEnabled = gPrefService.
+    getComplexValue(showCharacterEncodingPref, Ci.nsIPrefLocalizedString).data;
+  if (extraCharacterEncodingMenuEnabled !== "true") {
+    let charsetMenu = document.getElementById("appmenu_charsetMenu");
+    if (charsetMenu)
+      charsetMenu.setAttribute("hidden", "true");
   }
 
   Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
 }
 
 function BrowserShutdown()
 {
   if (Win7Features)
@@ -1557,16 +1626,17 @@ function BrowserShutdown()
     Components.utils.reportError(ex);
   }
 
   Services.obs.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
   Services.obs.removeObserver(gXPInstallObserver, "addon-install-blocked");
   Services.obs.removeObserver(gXPInstallObserver, "addon-install-failed");
   Services.obs.removeObserver(gXPInstallObserver, "addon-install-complete");
   Services.obs.removeObserver(gPluginHandler.pluginCrashed, "plugin-crashed");
+  Services.obs.removeObserver(gFormSubmitObserver, "invalidformsubmit");
 
   try {
     gBrowser.removeProgressListener(window.XULBrowserWindow);
     gBrowser.removeTabsProgressListener(window.TabsProgressListener);
   } catch (ex) {
   }
 
   PlacesStarButton.uninit();
@@ -1574,17 +1644,16 @@ function BrowserShutdown()
   try {
     gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
   } catch (ex) {
     Components.utils.reportError(ex);
   }
 
   BrowserOffline.uninit();
   OfflineApps.uninit();
-  DownloadMonitorPanel.uninit();
   gPrivateBrowsingUI.uninit();
   IndexedDBPromptHelper.uninit();
 
   var enumerator = Services.wm.getEnumerator(null);
   enumerator.getNext();
   if (!enumerator.hasMoreElements()) {
     document.persist("sidebar-box", "sidebarcommand");
     document.persist("sidebar-box", "width");
@@ -1607,17 +1676,17 @@ function BrowserShutdown()
 // nonBrowserWindowStartup(), nonBrowserWindowDelayedStartup(), and
 // nonBrowserWindowShutdown() are used for non-browser windows in
 // macBrowserOverlay
 function nonBrowserWindowStartup()
 {
   // Disable inappropriate commands / submenus
   var disabledItems = ['Browser:SavePage',
                        'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
-                       'viewToolbarsMenu', 'cmd_toggleTaskbar', 'viewSidebarMenuMenu', 'Browser:Reload',
+                       'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
                        'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
                        'viewHistorySidebar', 'Browser:AddBookmarkAs', 'View:PageInfo', 'Tasks:InspectPage'];
   var element;
 
   for (var id in disabledItems)
   {
     element = document.getElementById(disabledItems[id]);
     if (element)
@@ -1729,82 +1798,69 @@ function initializeSanitizer()
         }
       });
     }
 
     gPrefService.setBoolPref("privacy.sanitize.migrateFx3Prefs", true);
   }
 }
 
-function gotoHistoryIndex(aEvent)
-{
-  var index = aEvent.target.getAttribute("index");
+function gotoHistoryIndex(aEvent) {
+  let index = aEvent.target.getAttribute("index");
   if (!index)
     return false;
 
-  var where = whereToOpenLink(aEvent);
+  let where = whereToOpenLink(aEvent);
 
   if (where == "current") {
-    // Normal click.  Go there in the current tab and update session history.
+    // Normal click. Go there in the current tab and update session history.
 
     try {
       gBrowser.gotoIndex(index);
     }
     catch(ex) {
       return false;
     }
     return true;
   }
-  else {
-    // Modified click.  Go there in a new tab/window.
-    // This code doesn't copy history or work well with framed pages.
-
-    var sessionHistory = getWebNavigation().sessionHistory;
-    var entry = sessionHistory.getEntryAtIndex(index, false);
-    var url = entry.URI.spec;
-    openUILinkIn(url, where, {relatedToCurrent: true});
-    return true;
-  }
+  // Modified click. Go there in a new tab/window.
+
+  duplicateTabIn(gBrowser.selectedTab, where, index);
+  return true;
 }
 
 function BrowserForward(aEvent) {
-  var where = whereToOpenLink(aEvent, false, true);
+  let where = whereToOpenLink(aEvent, false, true);
 
   if (where == "current") {
     try {
       gBrowser.goForward();
     }
     catch(ex) {
     }
   }
   else {
-    var sessionHistory = getWebNavigation().sessionHistory;
-    var currentIndex = sessionHistory.index;
-    var entry = sessionHistory.getEntryAtIndex(currentIndex + 1, false);
-    var url = entry.URI.spec;
-    openUILinkIn(url, where, {relatedToCurrent: true});
+    let currentIndex = getWebNavigation().sessionHistory.index;
+    duplicateTabIn(gBrowser.selectedTab, where, currentIndex + 1);
   }
 }
 
 function BrowserBack(aEvent) {
-  var where = whereToOpenLink(aEvent, false, true);
+  let where = whereToOpenLink(aEvent, false, true);
 
   if (where == "current") {
     try {
       gBrowser.goBack();
     }
     catch(ex) {
     }
   }
   else {
-    var sessionHistory = getWebNavigation().sessionHistory;
-    var currentIndex = sessionHistory.index;
-    var entry = sessionHistory.getEntryAtIndex(currentIndex - 1, false);
-    var url = entry.URI.spec;
-    openUILinkIn(url, where, {relatedToCurrent: true});
+    let currentIndex = getWebNavigation().sessionHistory.index;
+    duplicateTabIn(gBrowser.selectedTab, where, currentIndex - 1);
   }
 }
 
 function BrowserHandleBackspace()
 {
   switch (gPrefService.getIntPref("browser.backspace_action")) {
   case 0:
     BrowserBack();
@@ -1844,22 +1900,21 @@ function BrowserReloadOrDuplicate(aEvent
 #else
     aEvent.ctrlKey;
 #endif
   if (aEvent.shiftKey && !backgroundTabModifier) {
     BrowserReloadSkipCache();
     return;
   }
 
-  var where = whereToOpenLink(aEvent, false, true);
+  let where = whereToOpenLink(aEvent, false, true);
   if (where == "current")
     BrowserReload();
   else
-    openUILinkIn(getWebNavigation().currentURI.spec, where,
-                 {relatedToCurrent: true});
+    duplicateTabIn(gBrowser.selectedTab, where);
 }
 
 function BrowserReload() {
   const reloadFlags = nsIWebNavigation.LOAD_FLAGS_NONE;
   BrowserReloadWithFlags(reloadFlags);
 }
 
 function BrowserReloadSkipCache() {
@@ -2267,66 +2322,16 @@ function BrowserPageInfo(doc, initialTab
     }
   }
 
   // We didn't find a matching window, so open a new one.
   return openDialog("chrome://browser/content/pageinfo/pageInfo.xul", "",
                     "chrome,toolbar,dialog=no,resizable", args);
 }
 
-#ifdef DEBUG
-// Initialize the LeakDetector class.
-function LeakDetector(verbose)
-{
-  this.verbose = verbose;
-}
-
-const NS_LEAKDETECTOR_CONTRACTID = "@mozilla.org/xpcom/leakdetector;1";
-
-if (NS_LEAKDETECTOR_CONTRACTID in Components.classes) {
-  try {
-    LeakDetector.prototype = Components.classes[NS_LEAKDETECTOR_CONTRACTID]
-                                       .createInstance(Components.interfaces.nsILeakDetector);
-  } catch (err) {
-    LeakDetector.prototype = Object.prototype;
-  }
-} else {
-  LeakDetector.prototype = Object.prototype;
-}
-
-var leakDetector = new LeakDetector(false);
-
-// Dumps current set of memory leaks.
-function dumpMemoryLeaks()
-{
-  leakDetector.dumpLeaks();
-}
-
-// Traces all objects reachable from the chrome document.
-function traceChrome()
-{
-  leakDetector.traceObject(document, leakDetector.verbose);
-}
-
-// Traces all objects reachable from the content document.
-function traceDocument()
-{
-  // keep the chrome document out of the dump.
-  leakDetector.markObject(document, true);
-  leakDetector.traceObject(content, leakDetector.verbose);
-  leakDetector.markObject(document, false);
-}
-
-// Controls whether or not we do verbose tracing.
-function traceVerbose(verbose)
-{
-  leakDetector.verbose = (verbose == "true");
-}
-#endif
-
 function URLBarSetURI(aURI) {
   var value = gBrowser.userTypedValue;
   var valid = false;
 
   if (value == null) {
     let uri = aURI || getWebNavigation().currentURI;
 
     // Replace initial page URIs with an empty string
@@ -2737,33 +2742,43 @@ var PrintPreviewListener = {
     this._chromeState.sidebarOpen = !sidebar.hidden;
     this._sidebarCommand = sidebar.getAttribute("sidebarcommand");
 
     var notificationBox = gBrowser.getNotificationBox();
     this._chromeState.notificationsOpen = !notificationBox.notificationsHidden;
     notificationBox.notificationsHidden = true;
 
     document.getElementById("sidebar").setAttribute("src", "about:blank");
-    var statusbar = document.getElementById("status-bar");
-    this._chromeState.statusbarOpen = !statusbar.hidden;
-    statusbar.hidden = true;
+    var addonBar = document.getElementById("addon-bar");
+    this._chromeState.addonBarOpen = !addonBar.collapsed;
+    addonBar.collapsed = true;
 
     this._chromeState.findOpen = gFindBarInitialized && !gFindBar.hidden;
     if (gFindBarInitialized)
       gFindBar.close();
+
+    this._chromeState.syncNotificationsOpen = false;
+    var syncNotifications = document.getElementById("sync-notifications");
+    if (syncNotifications) {
+      this._chromeState.syncNotificationsOpen = !syncNotifications.notificationsHidden;
+      syncNotifications.notificationsHidden = true;
+    }
   },
   _showChrome: function () {
     if (this._chromeState.notificationsOpen)
       gBrowser.getNotificationBox().notificationsHidden = false;
 
-    if (this._chromeState.statusbarOpen)
-      document.getElementById("status-bar").hidden = false;
+    if (this._chromeState.addonBarOpen)
+      document.getElementById("addon-bar").collapsed = false;
 
     if (this._chromeState.findOpen)
       gFindBar.open();
+
+    if (this._chromeState.syncNotificationsOpen)
+      document.getElementById("sync-notifications").notificationsHidden = false;
   }
 }
 
 function getMarkupDocumentViewer()
 {
   return gBrowser.markupDocumentViewer;
 }
 
@@ -2877,18 +2892,17 @@ var browserDragAndDrop = {
   canDropLink: function (aEvent) Services.droppedLinkHandler.canDropLink(aEvent, true),
 
   dragOver: function (aEvent, statusString)
   {
     if (this.canDropLink(aEvent)) {
       aEvent.preventDefault();
 
       if (statusString) {
-        var statusTextFld = document.getElementById("statusbar-display");
-        statusTextFld.label = gNavigatorBundle.getString(statusString);
+        XULBrowserWindow.setStatusText(gNavigatorBundle.getString(statusString));
       }
     }
   },
 
   drop: function (aEvent, aName) Services.droppedLinkHandler.dropLink(aEvent, aName)
 };
 
 var homeButtonObserver = {
@@ -2899,18 +2913,17 @@ var homeButtonObserver = {
 
   onDragOver: function (aEvent)
     {
       browserDragAndDrop.dragOver(aEvent, "droponhomebutton");
       aEvent.dropEffect = "link";
     },
   onDragLeave: function (aEvent)
     {
-      var statusTextFld = document.getElementById("statusbar-display");
-      statusTextFld.label = "";
+      XULWindowBrowser.setStatusText("");
     }
 }
 
 function openHomeDialog(aURL)
 {
   var promptTitle = gNavigatorBundle.getString("droponhometitle");
   var promptMsg   = gNavigatorBundle.getString("droponhomemsg");
   var pressedVal  = Services.prompt.confirmEx(window, promptTitle, promptMsg,
@@ -2919,18 +2932,16 @@ function openHomeDialog(aURL)
 
   if (pressedVal == 0) {
     try {
       var str = Components.classes["@mozilla.org/supports-string;1"]
                           .createInstance(Components.interfaces.nsISupportsString);
       str.data = aURL;
       gPrefService.setComplexValue("browser.startup.homepage",
                                    Components.interfaces.nsISupportsString, str);
-      var homeButton = document.getElementById("home-button");
-      homeButton.setAttribute("tooltiptext", aURL);
     } catch (ex) {
       dump("Failed to set the home page.\n"+ex+"\n");
     }
   }
 }
 
 var bookmarksButtonObserver = {
   onDrop: function (aEvent)
@@ -2945,31 +2956,29 @@ var bookmarksButtonObserver = {
   onDragOver: function (aEvent)
   {
     browserDragAndDrop.dragOver(aEvent, "droponbookmarksbutton");
     aEvent.dropEffect = "link";
   },
 
   onDragLeave: function (aEvent)
   {
-    var statusTextFld = document.getElementById("statusbar-display");
-    statusTextFld.label = "";
+    XULWindowBrowser.setStatusText("");
   }
 }
 
 var newTabButtonObserver = {
   onDragOver: function (aEvent)
   {
     browserDragAndDrop.dragOver(aEvent, "droponnewtabbutton");
   },
 
   onDragLeave: function (aEvent)
   {
-    var statusTextFld = document.getElementById("statusbar-display");
-    statusTextFld.label = "";
+    XULWindowBrowser.setStatusText("");
   },
 
   onDrop: function (aEvent)
   {
     let url = browserDragAndDrop.drop(aEvent, { });
     var postData = {};
     url = getShortcutOrURI(url, postData);
     if (url) {
@@ -2981,47 +2990,44 @@ var newTabButtonObserver = {
 
 var newWindowButtonObserver = {
   onDragOver: function (aEvent)
   {
     browserDragAndDrop.dragOver(aEvent, "droponnewwindowbutton");
   },
   onDragLeave: function (aEvent)
   {
-    var statusTextFld = document.getElementById("statusbar-display");
-    statusTextFld.label = "";
+    XULWindowBrowser.setStatusText("");
   },
   onDrop: function (aEvent)
   {
     let url = browserDragAndDrop.drop(aEvent, { });
     var postData = {};
     url = getShortcutOrURI(url, postData);
     if (url) {
       // allow third-party services to fixup this URL
       openNewWindowWith(url, null, postData.value, true);
     }
   }
 }
 
 var DownloadsButtonDNDObserver = {
   onDragOver: function (aEvent)
   {
-    var statusTextFld = document.getElementById("statusbar-display");
-    statusTextFld.label = gNavigatorBundle.getString("dropondownloadsbutton");
+    XULWindowBrowser.setStatusText(gNavigatorBundle.getString("dropondownloadsbutton"));
     var types = aEvent.dataTransfer.types;
     if (types.contains("text/x-moz-url") ||
         types.contains("text/uri-list") ||
         types.contains("text/plain"))
       aEvent.preventDefault();
   },
 
   onDragLeave: function (aEvent)
   {
-    var statusTextFld = document.getElementById("statusbar-display");
-    statusTextFld.label = "";
+    XULWindowBrowser.setStatusText("");
   },
 
   onDrop: function (aEvent)
   {
     let name = { };
     let url = browserDragAndDrop.drop(aEvent, name);
     if (url)
       saveURL(url, name, null, true, true);
@@ -3173,42 +3179,18 @@ const BrowserSearch = {
     var engines = (hidden ? browser.hiddenEngines : browser.engines) || [];
 
     engines.push({ uri: engine.href,
                    title: engine.title,
                    icon: iconURL });
 
     if (hidden)
       browser.hiddenEngines = engines;
-    else {
+    else
       browser.engines = engines;
-      if (browser == gBrowser.selectedBrowser)
-        this.updateSearchButton();
-    }
-  },
-
-  /**
-   * Update the browser UI to show whether or not additional engines are
-   * available when a page is loaded or the user switches tabs to a page that
-   * has search engines.
-   */
-  updateSearchButton: function() {
-    var searchBar = this.searchBar;
-
-    // The search bar binding might not be applied even though the element is
-    // in the document (e.g. when the navigation toolbar is hidden), so check
-    // for .searchButton specifically.
-    if (!searchBar || !searchBar.searchButton)
-      return;
-
-    var engines = gBrowser.selectedBrowser.engines;
-    if (engines && engines.length > 0)
-      searchBar.searchButton.setAttribute("addengines", "true");
-    else
-      searchBar.searchButton.removeAttribute("addengines");
   },
 
   /**
    * Gives focus to the search bar, if it is present on the toolbar, or loads
    * the default engine's search form otherwise. For Mac, opens a new window
    * or focuses an existing window, if necessary.
    */
   webSearch: function BrowserSearch_webSearch() {
@@ -3630,19 +3612,18 @@ var FullScreen = {
   _XULNS: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
   toggle: function (event) {
     var enterFS = window.fullScreen;
 
     // We get the fullscreen event _before_ the window transitions into or out of FS mode.
     if (event && event.type == "fullscreen")
       enterFS = !enterFS;
 
-    // show/hide all menubars, toolbars, and statusbars (except the full screen toolbar)
+    // show/hide all menubars, toolbars (except the full screen toolbar)
     this.showXULChrome("toolbar", !enterFS);
-    this.showXULChrome("statusbar", !enterFS);
     document.getElementById("View:FullScreen").setAttribute("checked", enterFS);
 
     if (enterFS) {
       // Add a tiny toolbar to receive mouseover and dragenter events, and provide affordance.
       // This will help simulate the "collapse" metaphor while also requiring less code and
       // events than raw listening of mouse coords.
       let fullScrToggler = document.getElementById("fullscr-toggler");
       if (!fullScrToggler) {
@@ -3950,17 +3931,16 @@ function mimeTypeIsTextBased(aMimeType)
 }
 
 var XULBrowserWindow = {
   // Stored Status, Link and Loading values
   status: "",
   defaultStatus: "",
   jsStatus: "",
   jsDefaultStatus: "",
-  overLink: "",
   startTime: 0,
   statusText: "",
   isBusy: false,
 
   _progressCollapseTimer: 0,
 
   QueryInterface: function (aIID) {
     if (aIID.equals(Ci.nsIWebProgressListener) ||
@@ -3969,34 +3949,26 @@ var XULBrowserWindow = {
         aIID.equals(Ci.nsIXULBrowserWindow) ||
         aIID.equals(Ci.nsISupports))
       return this;
     throw Cr.NS_NOINTERFACE;
   },
 
   get statusMeter () {
     delete this.statusMeter;
-    return this.statusMeter = document.getElementById("statusbar-icon");
+    return this.statusMeter = document.getElementById("urlbar-progress");
   },
   get stopCommand () {
     delete this.stopCommand;
     return this.stopCommand = document.getElementById("Browser:Stop");
   },
   get reloadCommand () {
     delete this.reloadCommand;
     return this.reloadCommand = document.getElementById("Browser:Reload");
   },
-  get statusTextField () {
-    delete this.statusTextField;
-    return this.statusTextField = document.getElementById("statusbar-display");
-  },
-  get securityButton () {
-    delete this.securityButton;
-    return this.securityButton = document.getElementById("security-button");
-  },
   get isImage () {
     delete this.isImage;
     return this.isImage = document.getElementById("isImage");
   },
   get _uriFixup () {
     delete this._uriFixup;
     return this._uriFixup = Cc["@mozilla.org/docshell/urifixup;1"]
                               .getService(Ci.nsIURIFixup);
@@ -4013,53 +3985,37 @@ var XULBrowserWindow = {
   },
 
   destroy: function () {
     // XXXjag to avoid leaks :-/, see bug 60729
     delete this.throbberElement;
     delete this.statusMeter;
     delete this.stopCommand;
     delete this.reloadCommand;
-    delete this.statusTextField;
-    delete this.securityButton;
     delete this.statusText;
   },
 
   setJSStatus: function (status) {
     this.jsStatus = status;
-    this.updateStatusField();
   },
 
   setJSDefaultStatus: function (status) {
     this.jsDefaultStatus = status;
-    this.updateStatusField();
   },
 
   setDefaultStatus: function (status) {
     this.defaultStatus = status;
-    this.updateStatusField();
-  },
-
-  setOverLink: function (link, b) {
+  },
+
+  setOverLink: function (link) {
     // Encode bidirectional formatting characters.
     // (RFC 3987 sections 3.2 and 4.1 paragraph 6)
-    this.overLink = link.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g,
-                                 encodeURIComponent);
-    this.updateStatusField();
-  },
-
-  updateStatusField: function () {
-    var text = this.overLink || this.status || this.jsStatus || this.jsDefaultStatus || this.defaultStatus;
-
-    // check the current value so we don't trigger an attribute change
-    // and cause needless (slow!) UI updates
-    if (this.statusText != text) {
-      this.statusTextField.label = text;
-      this.statusText = text;
-    }
+    link = link.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g,
+                        encodeURIComponent);
+    gURLBar.setOverLink(link);
   },
 
   onLinkIconAvailable: function (aIconURL) {
     if (gProxyFavIcon && gBrowser.userTypedValue === null)
       PageProxySetIcon(aIconURL); // update the favicon in the URL bar
   },
 
   onProgressChange: function (aWebProgress, aRequest,
@@ -4105,17 +4061,17 @@ var XULBrowserWindow = {
 
         // Turn the status meter on.
         this.statusMeter.value = 0;  // be sure to clear the progress bar
         if (this._progressCollapseTimer) {
           clearTimeout(this._progressCollapseTimer);
           this._progressCollapseTimer = 0;
         }
         else
-          this.statusMeter.parentNode.collapsed = false;
+          this.statusMeter.collapsed = false;
 
         // XXX: This needs to be based on window activity...
         this.stopCommand.removeAttribute("disabled");
         CombinedStopReload.switchToStop();
       }
     }
     else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
       if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
@@ -4169,33 +4125,38 @@ var XULBrowserWindow = {
 
       this.isBusy = false;
 
       if (this._busyUI) {
         this._busyUI = false;
 
         // Turn the progress meter and throbber off.
         this._progressCollapseTimer = setTimeout(function (self) {
-          self.statusMeter.parentNode.collapsed = true;
+          self.statusMeter.collapsed = true;
           self._progressCollapseTimer = 0;
         }, 100, this);
 
         if (this.throbberElement)
           this.throbberElement.removeAttribute("busy");
 
         this.stopCommand.setAttribute("disabled", "true");
         CombinedStopReload.switchToReload(aRequest instanceof Ci.nsIRequest);
       }
     }
   },
 
   onLocationChange: function (aWebProgress, aRequest, aLocationURI) {
     var location = aLocationURI ? aLocationURI.spec : "";
     this._hostChanged = true;
 
+    // Hide the form invalid popup.
+    if (gFormSubmitObserver.panelIsOpen()) {
+      gFormSubmitObserver.panel.hidePopup();
+    }
+
     if (document.tooltipNode) {
       // Optimise for the common case
       if (aWebProgress.DOMWindow == content) {
         document.getElementById("aHTMLTooltip").hidePopup();
         document.tooltipNode = null;
       }
       else {
         for (let tooltipWindow =
@@ -4301,22 +4262,20 @@ var XULBrowserWindow = {
     if (aRequest)
       setTimeout(function () { XULBrowserWindow.asyncUpdateUI(); }, 0);
     else
       this.asyncUpdateUI();
   },
 
   asyncUpdateUI: function () {
     FeedHandler.updateFeeds();
-    BrowserSearch.updateSearchButton();
   },
 
   onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
     this.status = aMessage;
-    this.updateStatusField();
   },
 
   // Properties used to cache security state used to update the UI
   _state: null,
   _tooltipText: null,
   _hostChanged: false, // onLocationChange will flip this bit
 
   onSecurityChange: function (aWebProgress, aRequest, aState) {
@@ -4371,31 +4330,25 @@ var XULBrowserWindow = {
         level = "low";
         break;
       case wpl.STATE_IS_BROKEN:
         level = "broken";
         break;
     }
 
     if (level) {
-      this.securityButton.setAttribute("level", level);
-      this.securityButton.hidden = false;
       // We don't style the Location Bar based on the the 'level' attribute
       // anymore, but still set it for third-party themes.
       if (gURLBar)
         gURLBar.setAttribute("level", level);
     } else {
-      this.securityButton.hidden = true;
-      this.securityButton.removeAttribute("level");
       if (gURLBar)
         gURLBar.removeAttribute("level");
     }
 
-    this.securityButton.setAttribute("tooltiptext", this._tooltipText);
-
     // Don't pass in the actual location object, since it can cause us to
     // hold on to the window object too long.  Just pass in the fields we
     // care about. (bug 424829)
     var location = gBrowser.contentWindow.location;
     var locationObj = {};
     try {
       locationObj.host = location.host;
       locationObj.hostname = location.hostname;
@@ -4404,17 +4357,17 @@ var XULBrowserWindow = {
       // Can sometimes throw if the URL being visited has no host/hostname,
       // e.g. about:blank. The _state for these pages means we won't need these
       // properties anyways, though.
     }
     gIdentityHandler.checkIdentity(this._state, locationObj);
   },
 
   // simulate all change notifications after switching tabs
-  onUpdateCurrentBrowser: function (aStateFlags, aStatus, aMessage, aTotalProgress) {
+  onUpdateCurrentBrowser: function XWB_onUpdateCurrentBrowser(aStateFlags, aStatus, aMessage, aTotalProgress) {
     if (FullZoom.updateBackgroundTabs)
       FullZoom.onLocationChange(gBrowser.currentURI, true);
     var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
     var loadingDone = aStateFlags & nsIWebProgressListener.STATE_STOP;
     // use a pseudo-object instead of a (potentially nonexistent) channel for getting
     // a correct error message - and make sure that the UI is always either in
     // loading (STATE_START) or done (STATE_STOP) mode
     this.onStateChange(
@@ -4425,31 +4378,31 @@ var XULBrowserWindow = {
     );
     // status message and progress value are undefined if we're done with loading
     if (loadingDone)
       return;
     this.onStatusChange(gBrowser.webProgress, null, 0, aMessage);
     this.onProgressChange(gBrowser.webProgress, 0, 0, aTotalProgress, 1);
   },
 
-  startDocumentLoad: function (aRequest) {
+  startDocumentLoad: function XWB_startDocumentLoad(aRequest) {
     // clear out feed data
     gBrowser.selectedBrowser.feeds = null;
 
     // clear out search-engine data
     gBrowser.selectedBrowser.engines = null;
 
     var uri = aRequest.QueryInterface(Ci.nsIChannel).URI;
     try {
       Services.obs.notifyObservers(content, "StartDocumentLoad", uri.spec);
     } catch (e) {
     }
   },
 
-  endDocumentLoad: function (aRequest, aStatus) {
+  endDocumentLoad: function XWB_endDocumentLoad(aRequest, aStatus) {
     var urlStr = aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec;
 
     var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad";
     try {
       Services.obs.notifyObservers(content, notification, urlStr);
     } catch (e) {
     }
   }
@@ -4711,55 +4664,57 @@ function onViewToolbarsPopupShowing(aEve
   if (popup != aEvent.currentTarget)
     return;
 
   var i;
 
   // Empty the menu
   for (i = popup.childNodes.length-1; i >= 0; --i) {
     var deadItem = popup.childNodes[i];
-    if (deadItem.hasAttribute("toolbarindex"))
+    if (deadItem.hasAttribute("toolbarId"))
       popup.removeChild(deadItem);
   }
 
   var firstMenuItem = aInsertPoint || popup.firstChild;
 
-  for (i = 0; i < gNavToolbox.childNodes.length; ++i) {
-    var toolbar = gNavToolbox.childNodes[i];
+  let toolbarNodes = [document.getElementById("addon-bar")];
+  for (i = 0; i < gNavToolbox.childNodes.length; ++i)
+    toolbarNodes.push(gNavToolbox.childNodes[i]);
+  toolbarNodes.forEach(function(toolbar) {
     var toolbarName = toolbar.getAttribute("toolbarname");
     if (toolbarName) {
       let menuItem = document.createElement("menuitem");
       let hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
                             "autohide" : "collapsed";
-      menuItem.setAttribute("toolbarindex", i);
+      menuItem.setAttribute("id", "toggle_" + toolbar.id);
+      menuItem.setAttribute("toolbarId", toolbar.id);
       menuItem.setAttribute("type", "checkbox");
       menuItem.setAttribute("label", toolbarName);
       menuItem.setAttribute("checked", toolbar.getAttribute(hidingAttribute) != "true");
       if (popup.id != "appmenu_customizeMenu")
         menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey"));
       popup.insertBefore(menuItem, firstMenuItem);
 
       menuItem.addEventListener("command", onViewToolbarCommand, false);
     }
-    toolbar = toolbar.nextSibling;
-  }
+  }, this);
 }
 
 function onViewToolbarCommand(aEvent) {
-  var index = aEvent.originalTarget.getAttribute("toolbarindex");
-  var toolbar = gNavToolbox.childNodes[index];
-  var visible = aEvent.originalTarget.getAttribute("checked") == "true";
-  setToolbarVisibility(toolbar, visible);
-}
-
-function setToolbarVisibility(toolbar, visible) {
+  var toolbarId = aEvent.originalTarget.getAttribute("toolbarId");
+  var toolbar = document.getElementById(toolbarId);
+  var isVisible = aEvent.originalTarget.getAttribute("checked") == "true";
+  setToolbarVisibility(toolbar, isVisible);
+}
+
+function setToolbarVisibility(toolbar, isVisible) {
   var hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
                         "autohide" : "collapsed";
 
-  toolbar.setAttribute(hidingAttribute, !visible);
+  toolbar.setAttribute(hidingAttribute, !isVisible);
   document.persist(toolbar.id, hidingAttribute);
 
   PlacesToolbarHelper.init();
   BookmarksMenuButton.updatePosition();
 
 #ifdef MENUBAR_CAN_AUTOHIDE
   updateAppButtonDisplay();
 #endif
@@ -4936,17 +4891,20 @@ var gHomeButton = {
 
   updateTooltip: function (homeButton)
   {
     if (!homeButton)
       homeButton = document.getElementById("home-button");
     if (homeButton) {
       var homePage = this.getHomePage();
       homePage = homePage.replace(/\|/g,', ');
-      homeButton.setAttribute("tooltiptext", homePage);
+      if (homePage.toLowerCase() == "about:home")
+        homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip"));
+      else
+        homeButton.setAttribute("tooltiptext", homePage);
     }
   },
 
   getHomePage: function ()
   {
     var url;
     try {
       url = gPrefService.getComplexValue(this.prefDomain,
@@ -5494,17 +5452,17 @@ function setStyleDisabled(disabled) {
 /* End of the Page Style functions */
 
 var BrowserOffline = {
   /////////////////////////////////////////////////////////////////////////////
   // BrowserOffline Public Methods
   init: function ()
   {
     if (!this._uiElement)
-      this._uiElement = document.getElementById("goOfflineMenuitem");
+      this._uiElement = document.getElementById("workOfflineMenuitemState");
 
     Services.obs.addObserver(this, "network:offline-status-changed", false);
 
     this._updateOfflineUI(Services.io.offline);
   },
 
   uninit: function ()
   {
@@ -6640,33 +6598,17 @@ function convertFromUnicode(charset, str
 }
 
 /**
  * The Feed Handler object manages discovery of RSS/ATOM feeds in web pages
  * and shows UI when they are discovered.
  */
 var FeedHandler = {
   /**
-   * The click handler for the Feed icon in the location bar. Opens the
-   * subscription page if user is not given a choice of feeds.
-   * (Otherwise the list of available feeds will be presented to the
-   * user in a popup menu.)
-   */
-  onFeedButtonClick: function(event) {
-    event.stopPropagation();
-
-    if (event.target.hasAttribute("feed") &&
-        event.eventPhase == Event.AT_TARGET &&
-        (event.button == 0 || event.button == 1)) {
-        this.subscribeToFeed(null, event);
-    }
-  },
-
-  /**
-   * Called when the user clicks on the Feed icon in the location bar.
+   * Called when the user clicks on the Subscribe to This Page... menu item.
    * Builds a menu of unique feeds associated with the page, and if there
    * is only one, shows the feed inline in the browser window.
    * @param   menuPopup
    *          The feed list menupopup to be populated.
    * @returns true if the menu should be shown, false if there was only
    *          one feed and the feed should be shown inline in the browser
    *          window (do not show the menupopup).
    */
@@ -6681,23 +6623,16 @@ var FeedHandler = {
       // refuses to work past this point.
       menuPopup.parentNode.removeAttribute("open");
       return false;
     }
 
     while (menuPopup.firstChild)
       menuPopup.removeChild(menuPopup.firstChild);
 
-    if (feeds.length == 1) {
-      var feedButton = document.getElementById("feed-button");
-      if (feedButton)
-        feedButton.setAttribute("feed", feeds[0].href);
-      return false;
-    }
-
     // Build the menu showing the available feed choices for viewing.
     for (var i = 0; i < feeds.length; ++i) {
       var feedInfo = feeds[i];
       var menuItem = document.createElement("menuitem");
       var baseTitle = feedInfo.title || feedInfo.href;
       var labelStr = gNavigatorBundle.getFormattedString("feedShowFeedNew", [baseTitle]);
       menuItem.setAttribute("class", "feed-menuitem");
       menuItem.setAttribute("label", labelStr);
@@ -6759,40 +6694,26 @@ var FeedHandler = {
     return this._feedMenupopup = document.getElementById("multipleFeedsMenuState");
   },
 
   /**
    * Update the browser UI to show whether or not feeds are available when
    * a page is loaded or the user switches tabs to a page that has feeds.
    */
   updateFeeds: function() {
-    var feedButton = document.getElementById("feed-button");
-
     var feeds = gBrowser.selectedBrowser.feeds;
     if (!feeds || feeds.length == 0) {
-      if (feedButton) {
-        feedButton.collapsed = true;
-        feedButton.removeAttribute("feed");
-      }
       this._feedMenuitem.setAttribute("disabled", "true");
       this._feedMenupopup.setAttribute("hidden", "true");
       this._feedMenuitem.removeAttribute("hidden");
     } else {
-      if (feedButton)
-        feedButton.collapsed = false;
-
       if (feeds.length > 1) {
         this._feedMenuitem.setAttribute("hidden", "true");
         this._feedMenupopup.removeAttribute("hidden");
-        if (feedButton)
-          feedButton.removeAttribute("feed");
       } else {
-        if (feedButton)
-          feedButton.setAttribute("feed", feeds[0].href);
-
         this._feedMenuitem.setAttribute("feed", feeds[0].href);
         this._feedMenuitem.removeAttribute("disabled");
         this._feedMenuitem.removeAttribute("hidden");
         this._feedMenupopup.setAttribute("hidden", "true");
       }
     }
   },
 
@@ -6803,22 +6724,16 @@ var FeedHandler = {
       // ignore feeds loaded in subframes (see bug 305472)
       return;
     }
 
     if (!browserForLink.feeds)
       browserForLink.feeds = [];
 
     browserForLink.feeds.push({ href: link.href, title: link.title });
-
-    if (browserForLink == gBrowser.selectedBrowser) {
-      var feedButton = document.getElementById("feed-button");
-      if (feedButton)
-        feedButton.collapsed = false;
-    }
   }
 };
 
 /**
  * Re-open a closed tab.
  * @param aIndex
  *        The index of the tab (via nsSessionStore.getClosedTabData)
  * @returns a reference to the reopened tab.
@@ -7615,20 +7530,16 @@ let gPrivateBrowsingUI = {
       docElement.setAttribute("title",
         docElement.getAttribute("title_privatebrowsing"));
       docElement.setAttribute("titlemodifier",
         docElement.getAttribute("titlemodifier_privatebrowsing"));
       docElement.setAttribute("browsingmode", "private");
       gBrowser.updateTitlebar();
     }
 
-    setTimeout(function () {
-      DownloadMonitorPanel.updateStatus();
-    }, 0);
-
     if (!aOnWindowOpen && this._disableUIOnToggle)
       document.getElementById("Tools:PrivateBrowsing")
               .setAttribute("disabled", "true");
   },
 
   onExitPrivateBrowsing: function PBUI_onExitPrivateBrowsing() {
     if (BrowserSearch.searchBar) {
       let searchBox = BrowserSearch.searchBar.textbox;
@@ -7677,20 +7588,16 @@ let gPrivateBrowsingUI = {
     document.getElementById("appmenu_privateBrowsing")
             .removeAttribute("disabled");
 #endif
     document.getElementById("Tools:PrivateBrowsing")
             .removeAttribute("disabled");
 
     gLastOpenDirectory.reset();
 
-    setTimeout(function () {
-      DownloadMonitorPanel.updateStatus();
-    }, 0);
-
     if (this._disableUIOnToggle)
       document.getElementById("Tools:PrivateBrowsing")
               .setAttribute("disabled", "true");
   },
 
   _setPBMenuTitle: function PBUI__setPBMenuTitle(aMode) {
     let pbMenuItem = document.getElementById("privateBrowsingItem");
     pbMenuItem.setAttribute("label", pbMenuItem.getAttribute(aMode + "label"));
@@ -7984,16 +7891,22 @@ function switchToTabHavingURI(aURI, aOpe
       }, true);
     }
     return true;
   }
 
   return false;
 }
 
+function restoreLastSession() {
+  let ss = Cc["@mozilla.org/browser/sessionstore;1"].
+           getService(Ci.nsISessionStore);
+  ss.restoreLastSession();
+}
+
 var TabContextMenu = {
   contextTab: null,
   updateContextMenu: function updateContextMenu(aPopupMenu) {
     this.contextTab = document.popupNode.localName == "tab" ?
                       document.popupNode : gBrowser.selectedTab;
     let disabled = gBrowser.visibleTabs.length == 1;
 
     // Enable the "Close Tab" menuitem when the window doesn't close with the last tab.
@@ -8027,8 +7940,69 @@ XPCOMUtils.defineLazyGetter(this, "HUDCo
   try {
     return HUDService.consoleUI;
   }
   catch (ex) {
     Components.utils.reportError(ex);
   }
 });
 
+// Prompt user to restart the browser in safe mode 
+function safeModeRestart()
+{
+  // prompt the user to confirm 
+  let promptTitle = gNavigatorBundle.getString("safeModeRestartPromptTitle");
+  let promptMessage = 
+    gNavigatorBundle.getString("safeModeRestartPromptMessage");
+  let rv = Services.prompt.confirm(window, promptTitle, promptMessage);
+  if (rv) {
+    let environment = Components.classes["@mozilla.org/process/environment;1"].
+      getService(Components.interfaces.nsIEnvironment);
+    environment.set("MOZ_SAFE_MODE_RESTART", "1");
+    Application.restart();
+  }
+}
+
+/* duplicateTabIn duplicates tab in a place specified by the parameter |where|.
+ *
+ * |where| can be:
+ *  "tab"         new tab
+ *  "tabshifted"  same as "tab" but in background if default is to select new
+ *                tabs, and vice versa
+ *  "window"      new window
+ *
+ * historyIndex is an index the page can navigate to after the new tab is
+ * created and loaded, it can for example be used to go back one page after the
+ * tab is duplicated.
+ */
+function duplicateTabIn(aTab, where, historyIndex) {
+  let newTab = gBrowser.duplicateTab(aTab);
+
+  // Go to index if it's provided, fallback to loadURI if there's no history.
+  if (historyIndex != null) {
+    try {
+      gBrowser.getBrowserForTab(newTab).gotoIndex(historyIndex);
+    }
+    catch (ex) {
+      let sessionHistory = aTab.linkedBrowser.sessionHistory;
+      let entry = sessionHistory.getEntryAtIndex(historyIndex, false);
+      let fallbackUrl = entry.URI.spec;
+      gBrowser.getBrowserForTab(newTab).loadURI(fallbackUrl);
+    }
+  }
+
+  var loadInBackground =
+    getBoolPref("browser.tabs.loadBookmarksInBackground", false);
+
+  switch (where) {
+    case "window":
+      gBrowser.hideTab(newTab);
+      gBrowser.replaceTabWithWindow(newTab);
+      break;
+    case "tabshifted":
+      loadInBackground = !loadInBackground;
+      // fall through
+    case "tab":
+      if (!loadInBackground)
+        gBrowser.selectedTab = newTab;
+      break;
+  }
+}
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -30,16 +30,17 @@
 #   Pierre Chanial <chanial@noos.fr>
 #   Dean Tessman <dean_tessman@hotmail.com>
 #   Johnathan Nightingale <johnath@mozilla.com>
 #   Dão Gottwald <dao@mozilla.com>
 #   Ehsan Akhgari <ehsan.akhgari@gmail.com>
 #   Robert Strong <robert.bugzilla@gmail.com>
 #   Rob Campbell <rcampbell@mozilla.com>
 #   Patrick Walton <pcwalton@mozilla.com>
+#   David Dahl <ddahl@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -111,35 +112,35 @@
                onpopupshowing="if (event.target == this) TabContextMenu.updateContextMenu(this);"
                onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;">
       <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;"
                 oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/>
       <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
                 tbattr="tabbrowser-multiple"
                 oncommand="gBrowser.reloadAllTabs();"/>
       <menuseparator/>
-      <menuitem id="context_openTabInWindow" label="&openTabInNewWindow.label;"
-                accesskey="&openTabInNewWindow.accesskey;"
-                tbattr="tabbrowser-multiple"
-                oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
-      <menuitem id="context_pinTab" label="&pinTab.label;"
-                accesskey="&pinTab.accesskey;"
+      <menuitem id="context_pinTab" label="&pinAppTab.label;"
+                accesskey="&pinAppTab.accesskey;"
                 oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/>
-      <menuitem id="context_unpinTab" label="&unpinTab.label;" hidden="true"
-                accesskey="&unpinTab.accesskey;"
+      <menuitem id="context_unpinTab" label="&unpinAppTab.label;" hidden="true"
+                accesskey="&unpinAppTab.accesskey;"
                 oncommand="gBrowser.unpinTab(TabContextMenu.contextTab);"/>
       <menu id="context_tabViewMenu" label="&moveToGroup.label;"
             accesskey="&moveToGroup.accesskey;">
         <menupopup id="context_tabViewMenuPopup"
                    onpopupshowing="if (event.target == this) TabView.updateContextMenu(TabContextMenu.contextTab, this);">
           <menuseparator id="context_tabViewNamedGroups" hidden="true"/>
           <menuitem label="&moveToNewGroup.label;"
                     oncommand="TabView.moveTabTo(TabContextMenu.contextTab, null);"/>
         </menupopup>
       </menu>
+      <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
+                accesskey="&moveToNewWindow.accesskey;"
+                tbattr="tabbrowser-multiple"
+                oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
       <menuseparator/>
       <menuitem id="context_bookmarkAllTabs"
                 label="&bookmarkAllTabs.label;"
                 accesskey="&bookmarkAllTabs.accesskey;"
                 command="Browser:BookmarkAllTabs"/>
       <menuseparator/>
       <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
                 oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
@@ -158,16 +159,19 @@
     <tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
 
     <!-- for search and content formfill/pw manager -->
     <panel type="autocomplete" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
 
     <!-- for url bar autocomplete -->
     <panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
 
+    <!-- for invalid form error message -->
+    <panel id="invalid-form-popup" noautofocus="true" hidden="true" level="parent"/>
+
     <panel id="editBookmarkPanel"
            orient="vertical"
            ignorekeys="true"
            hidden="true"
            onpopupshown="StarUI.panelShown(event);"
            aria-labelledby="editBookmarkPanelTitle">
       <row id="editBookmarkPanelHeader" align="center" hidden="true">
         <vbox align="center">
@@ -407,17 +411,17 @@
         <spacer flex="1"/>
         <toolbarbutton class="KUI-panel-closebutton"
                        oncommand="allTabs.close()"
                        tooltiptext="&closeCmd.label;"/>
       </hbox>
       <stack id="allTabs-stack">
         <vbox id="allTabs-container"><hbox/></vbox>
         <toolbarbutton id="allTabs-tab-close-button"
-                       class="tab-close-button"
+                       class="tabs-closebutton"
                        oncommand="allTabs.closeTab(event);"
                        tooltiptext="&closeCmd.label;"
                        style="visibility:hidden"/>
       </stack>
     </panel>
 
     <!-- Bookmarks and history tooltip -->
     <tooltip id="bhTooltip"/>
@@ -433,20 +437,28 @@
   </popupset>
 
 #ifdef MENUBAR_CAN_AUTOHIDE
   <vbox id="titlebar">
   <hbox id="titlebar-content">
   <hbox id="appmenu-button-container" align="start">
   <button id="appmenu-button"
           type="menu"
+#ifdef XP_WIN
           label="&brandShortName;"
+#else
+          label="&appMenuButton.label;"
+#endif
           style="-moz-user-focus: ignore;">
     <menupopup id="appmenu-popup"
+#ifdef MOZ_SERVICES_SYNC
+               onpopupshowing="updateEditUIVisibility();gSyncUI.updateUI();">
+#else
                onpopupshowing="updateEditUIVisibility();">
+#endif
       <hbox>
         <vbox id="appmenuPrimaryPane">
           <hbox flex="1"
                 class="split-menuitem">
             <menuitem id="appmenu_newTab"
                       class="menuitem-tooltip split-menuitem-item"
                       flex="1"
                       label="&tabCmd.label;"
@@ -472,20 +484,25 @@
           </hbox>
           <menuitem id="appmenu_privateBrowsing"
                     class="menuitem-iconic menuitem-iconic-tooltip"
                     label="&privateBrowsingCmd.start.label;"
                     startlabel="&privateBrowsingCmd.start.label;"
                     stoplabel="&privateBrowsingCmd.stop.label;"
                     command="Tools:PrivateBrowsing"
                     key="key_privatebrowsing"/>
+          <menuitem label="&goOfflineCmd.label;"
+                    id="appmenu_offlineModeRecovery"
+                    type="checkbox"
+                    observes="workOfflineMenuitemState"
+                    oncommand="BrowserOffline.toggleOfflineStatus();"/>
           <menuseparator class="appmenu-menuseparator"/>
-          <hbox class="split-menuitem">
-            <menuitem id="appmenu-edit-menuitem"
-                      label="&editMenu.label;"
+          <hbox>
+            <menuitem id="appmenu-edit-label"
+                      label="&appMenuEdit.label;"
                       disabled="true"/>
             <toolbarbutton id="appmenu-cut"
                            class="appmenu-edit-button"
                            command="cmd_cut"
                            onclick="if (!this.disabled) hidePopup();"
                            tooltiptext="&cutButton.tooltip;"/>
             <toolbarbutton id="appmenu-copy"
                            class="appmenu-edit-button"
@@ -532,19 +549,19 @@
                           command="cmd_printPreview"/>
                 <menuitem id="appmenu_printSetup"
                           label="&printSetupCmd.label;"
                           command="cmd_pageSetup"/>
               </menupopup>
             </menu>
           </hbox>
           <menuseparator class="appmenu-menuseparator"/>
-          <menu id="appmenu_developer"
-                label="&developerMenu.label;">
-            <menupopup id="appmenu_developer_popup">
+          <menu id="appmenu_webDeveloper"
+                label="&appMenuWebDeveloper.label;">
+            <menupopup id="appmenu_webDeveloper_popup">
               <menuitem id="appmenu_webConsole"
                         label="&webConsoleCmd.label;"
                         type="checkbox"
                         oncommand="HUDConsoleUI.toggleHUD();"
                         key="key_webConsole"/>
               <menuitem id="appmenu_pageInspect"
                         hidden="true"
                         label="&inspectMenu.label;"
@@ -552,26 +569,30 @@
                         command="Tools:Inspect"
                         key="key_inspect"/>
               <menuseparator/>
               <menuitem id="appmenu_pageSource"
                         label="&viewPageSourceCmd.label;"
                         command="View:PageSource"
                         key="key_viewSource"/>
               <menuseparator/>
-#define ID_PREFIX appmenu_
+#define ID_PREFIX appmenu_developer_
 #include browser-charsetmenu.inc
 #undef ID_PREFIX
               <menuseparator/>
               <menuitem label="&goOfflineCmd.label;"
                         type="checkbox"
+                        observes="workOfflineMenuitemState"
                         oncommand="BrowserOffline.toggleOfflineStatus();"/>
             </menupopup>
           </menu>
           <menuseparator class="appmenu-menuseparator"/>
+#define ID_PREFIX appmenu_
+#include browser-charsetmenu.inc
+#undef ID_PREFIX
           <menuitem id="appmenu_fullScreen"
                     class="menuitem-tooltip"
                     label="&fullScreenCmd.label;"
                     type="checkbox"
                     observes="View:FullScreen"
                     key="key_fullScreen"/>
           <menuitem id="appmenu-quit"
                     class="menuitem-iconic"
@@ -662,16 +683,21 @@
                           command="Browser:ShowAllHistory"
                           key="showAllHistoryKb"/>
                 <menuseparator/>
                 <menuitem id="appmenu_sanitizeHistory"
                           label="&clearRecentHistory.label;"
                           key="key_sanitize"
                           command="Tools:Sanitize"/>
                 <menuseparator class="hide-if-empty-places-result"/>
+                <menuitem id="appmenu_restoreLastSession"
+                          class="restoreLastSession"
+                          label="&historyRestoreLastSession.label;"
+                          oncommand="restoreLastSession();"
+                          disabled="true"/>
                 <menu id="appmenu_recentlyClosedTabsMenu"
                       class="recentlyClosedTabsMenu"
                       label="&historyUndoMenu.label;"
                       disabled="true">
                   <menupopup id="appmenu_recentlyClosedTabsMenupopup"
                              onpopupshowing="document.getElementById('appmenu_historyMenu')._placesView.populateUndoSubmenu();"/>
                 </menu>
                 <menu id="appmenu_recentlyClosedWindowsMenu"
@@ -700,29 +726,25 @@
               <menuitem id="appmenu_customize"
                         label="&preferencesCmd.label;"
                         class="split-menuitem-item"
                         flex="1"
                         oncommand="openPreferences();"/>
               <menu class="split-menuitem-menu"
                     label="&preferencesCmd.label;">
                 <menupopup id="appmenu_customizeMenu"
-                           onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleStatusbar'));">
+                           onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleTabsOnTop').previousSibling);">
                   <menuitem id="appmenu_preferences"
 #ifdef XP_UNIX
                             label="&preferencesCmdUnix.label;"
 #else
                             label="&preferencesCmd.label;"
 #endif
                             oncommand="openPreferences();"/>
                   <menuseparator/>
-                  <menuitem id="appmenu_toggleStatusbar"
-                            type="checkbox"
-                            command="cmd_toggleTaskbar"
-                            observes="toggle_taskbar"/>
                   <menuseparator/>
                   <menuitem id="appmenu_toggleTabsOnTop"
                             label="&viewTabsOnTop.label;"
                             type="checkbox"
                             command="cmd_ToggleTabsOnTop"/>
                   <menuitem id="appmenu_toolbarLayout"
                             label="&appMenuToolbarLayout.label;"
                             command="cmd_CustomizeToolbars"/>
@@ -740,23 +762,44 @@
                   <menuitem id="appmenu_openHelp"
                             label="&helpMenu.label;"
                             oncommand="openHelpLink('firefox-help')"
                             onclick="checkForMiddleClick(this, event);"/>
                   <menuitem id="appmenu_gettingStarted"
                             label="&appMenuGettingStarted.label;"
                             oncommand="gBrowser.loadOneTab('http://www.mozilla.com/firefox/central/', {inBackground: false});"
                             onclick="checkForMiddleClick(this, event);"/>
+                  <menuitem id="appmenu_troubleshootingInfo"
+                            label="&helpTroubleshootingInfo.label;"
+                            oncommand="openTroubleshootingPage()"
+                            onclick="checkForMiddleClick(this,event);"/>
+                  <menuseparator/>
+                  <menuitem id="appmenu_safeMode"
+                            accesskey="&appMenuSafeMode.accesskey;"
+                            label="&appMenuSafeMode.label;"
+                            oncommand="safeModeRestart();"/>
                   <menuseparator/>
                   <menuitem id="appmenu_about"
                             label="&aboutProduct.label;"
                             oncommand="openAboutDialog();"/>
                 </menupopup>
               </menu>
             </hbox>
+#ifdef MOZ_SERVICES_SYNC
+            <spacer flex="1"/>
+            <!-- only one of sync-setup or sync-syncnow will be showing at once -->
+            <menuitem id="sync-setup-appmenu"
+                      label="&syncSetup.label;"
+                      observes="sync-setup-state"
+                      oncommand="gSyncUI.openSetup()"/>
+            <menuitem id="sync-syncnowitem-appmenu"
+                      label="&syncSyncNowItem.label;"
+                      observes="sync-syncnow-state"
+                      oncommand="gSyncUI.doSync(event);"/>
+#endif
         </vbox>
       </hbox>
     </menupopup>
   </button>
   </hbox>
   <spacer id="titlebar-spacer" flex="1"/>
   <hbox id="titlebar-buttonbox">
     <toolbarbutton id="titlebar-min" oncommand="window.minimize();"/>
@@ -843,17 +886,18 @@
 
       <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      persist="class" removable="true"
                      label="&homeButton.label;"
                      ondragover="homeButtonObserver.onDragOver(event)"
                      ondragenter="homeButtonObserver.onDragOver(event)"
                      ondrop="homeButtonObserver.onDrop(event)"
                      ondragleave="homeButtonObserver.onDragLeave(event)"
-                     onclick="BrowserGoHome(event);"/>
+                     onclick="BrowserGoHome(event);"
+                     aboutHomeOverrideTooltip="&abouthome.pageTitle;"/>
 
       <toolbaritem id="urlbar-container" align="center" flex="400" persist="width" combined="true"
                    title="&locationItem.title;" class="chromeclass-location" removable="true">
         <textbox id="urlbar" flex="1"
                  placeholder="&urlbar.placeholder;"
                  type="autocomplete"
                  autocompletesearch="history"
                  autocompletesearchparam="enable-actions"
@@ -898,37 +942,25 @@
               <hbox id="identity-icon-labels">
                 <label id="identity-icon-label" class="plain" flex="1"/>
                 <label id="identity-icon-country-label" class="plain"/>
               </hbox>
             </hbox>
           </box>
           <label id="urlbar-display" value="&urlbar.switchToTab.label;"/>
           <hbox id="urlbar-icons">
-            <button type="menu"
-                    style="-moz-user-focus: none"
-                    class="plain urlbar-icon"
-                    id="feed-button"
-                    collapsed="true"
-                    tooltiptext="&feedButton.tooltip;"
-                    onclick="return FeedHandler.onFeedButtonClick(event);">
-              <menupopup position="after_end"
-                         id="feed-menu"
-                         onpopupshowing="return FeedHandler.buildFeedList(this);"
-                         oncommand="return FeedHandler.subscribeToFeed(null, event);"
-                         onclick="checkForMiddleClick(this, event);"/>
-            </button>
             <image id="star-button"
                    class="urlbar-icon"
                    onclick="PlacesStarButton.onClick(event);"/>
             <image id="go-button"
                    class="urlbar-icon"
                    tooltiptext="&goEndCap.tooltip;"
                    onclick="gURLBar.handleCommand(event);"/>
           </hbox>
+          <progressmeter id="urlbar-progress" mode="normal" value="0" collapsed="true"/>
           <toolbarbutton id="urlbar-go-button"
                          onclick="gURLBar.handleCommand(event);"
                          tooltiptext="&goEndCap.tooltip;"/>
           <toolbarbutton id="urlbar-reload-button"
                          command="Browser:ReloadOrDuplicate"
                          onclick="checkForMiddleClick(this, event);"
                          tooltiptext="&reloadButton.tooltip;"/>
           <toolbarbutton id="urlbar-stop-button"
@@ -972,16 +1004,29 @@
                      context="placesContext"
                      openInTabs="children"
                      oncommand="BookmarksEventHandler.onCommand(event);"
                      onclick="BookmarksEventHandler.onClick(event);"
                      onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
                                      if (!this.parentNode._placesView)
                                        new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
                      tooltip="bhTooltip" popupsinherittooltip="true">
+            <menuitem id="BMB_subscribeToPageMenuitem"
+                      label="&subscribeToPageMenuitem.label;"
+                      oncommand="return FeedHandler.subscribeToFeed(null, event);"
+                      onclick="checkForMiddleClick(this, event);"
+                      observes="singleFeedMenuitemState"/>
+            <menu id="BMB_subscribeToPageMenupopup"
+                  label="&subscribeToPageMenupopup.label;"
+                  observes="multipleFeedsMenuState">
+              <menupopup id="BMB_subscribeToPageSubmenuMenupopup"
+                         onpopupshowing="return FeedHandler.buildFeedList(event.target);"
+                         oncommand="return FeedHandler.subscribeToFeed(null, event);"
+                         onclick="checkForMiddleClick(this, event);"/>
+            </menu>
             <menuitem id="BMB_bookmarkAllTabs"
                       label="&addCurPagesCmd.label;"
                       command="Browser:BookmarkAllTabs"
                       key="bookmarkAllTabsKb"/>
             <menuitem id="BMB_bookmarksShowAll"
                       label="&showAllBookmarks.label;"
                       command="Browser:ShowAllBookmarks"
                       key="manBookmarkKb"/>
@@ -1125,20 +1170,21 @@
                      label="&listAllTabs.label;"
                      tooltiptext="&listAllTabs.label;"
                      removable="true">
         <menupopup id="alltabs-popup"
                    position="after_end"/>
       </toolbarbutton>
 
       <toolbarbutton id="tabview-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
-                     label="&tabViewButton2.label;"
+                     label="&tabGroupsButton.label;"
                      command="Browser:ToggleTabView"
-                     tooltiptext="&tabViewButton2.tooltip;"
-                     removable="true"/>
+                     tooltiptext="&tabGroupsButton.tooltip;"
+                     removable="true"
+                     observes="tabviewGroupsNumber"/>
 
       <toolbarbutton id="tabs-closebutton"
                      class="close-button tabs-closebutton"
                      command="cmd_close"
                      label="&closeTab.label;"
                      tooltiptext="&closeTab.label;"/>
 
     </toolbar>
@@ -1203,16 +1249,33 @@
                      tooltiptext="&pasteButton.tooltip;"/>
 
       <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      observes="View:FullScreen"
                      type="checkbox"
                      label="&fullScreenCmd.label;"
                      tooltiptext="&fullScreenButton.tooltip;"/>
 
+      <toolbaritem id="zoom-controls" class="chromeclass-toolbar-additional"
+                   title="&zoomControls.label;">
+        <toolbarbutton id="zoom-out-button" class="toolbarbutton-1"
+                       label="&fullZoomReduceCmd.label;"
+                       command="cmd_fullZoomReduce"
+                       tooltiptext="&zoomOutButton.tooltip;"/>
+        <toolbarbutton id="zoom-in-button" class="toolbarbutton-1"
+                       label="&fullZoomEnlargeCmd.label;"
+                       command="cmd_fullZoomEnlarge"
+                       tooltiptext="&zoomInButton.tooltip;"/>
+      </toolbaritem>
+#ifdef MOZ_SERVICES_SYNC
+      <toolbarbutton id="sync-button"
+                     class="toolbarbutton-1 chromeclass-toolbar-additional"
+                     label="&syncToolbarButton.label;"
+                     oncommand="gSyncUI.handleToolbarButton()"/>
+#endif
     </toolbarpalette>
   </toolbox>
 
   <hbox flex="1" id="browser">
     <vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
       <sidebarheader id="sidebar-header" align="center">
         <label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
         <image id="sidebar-throbber"/>
@@ -1229,62 +1292,26 @@
                   tabcontainer="tabbrowser-tabs"
                   contentcontextmenu="contentAreaContextMenu"
                   autocompletepopup="PopupAutoComplete"
                   onclick="return contentAreaClick(event, false);"/>
     </vbox>
   </hbox>
 
   <vbox id="browser-bottombox" layer="true">
-    <statusbar class="chromeclass-status" id="status-bar"
-#ifdef WINCE
-               hidden="true"
-#endif
-               >
-      <statusbarpanel id="statusbar-display" label="" flex="1"/>
-      <statusbarpanel class="statusbarpanel-progress" collapsed="true" id="statusbar-progresspanel">
-        <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/>
-      </statusbarpanel>
-      <statusbarpanel id="download-monitor" class="statusbarpanel-iconic-text"
-                      tooltiptext="&downloadMonitor2.tooltip;" hidden="true"
-                      command="Tools:Downloads"/>
-      <statusbarpanel id="security-button" class="statusbarpanel-iconic"
-                      hidden="true"
-                      onclick="if (event.button == 0 &amp;&amp; event.detail == 1) displaySecurityInfo();"/>
-#ifdef MOZ_SERVICES_SYNC
-      <statusbarpanel id="sync-status-button"
-                      class="statusbarpanel-iconic"
-                      image="chrome://browser/skin/sync-16.png"
-                      label="&syncLogInItem.label;"
-                      oncommand="gSyncUI.handleStatusbarButton();"
-                      onmousedown="event.preventDefault();">
-      </statusbarpanel>
-      <separator class="thin"/>
-      <statusbarpanel id="sync-notifications-button"
-                      class="statusbarpanel-iconic-text"
-                      hidden="true"
-                      popup="sync-notifications-panel">
-      </statusbarpanel>
-      <panel id="sync-notifications-panel" position="before_end">
-          <notificationbox id="sync-notifications-box"/>
-      </panel>
-#endif
-      <statusbarpanel id="page-report-button" type="menu"
-                      class="statusbarpanel-menu-iconic"
-                      hidden="true"
-                      tooltiptext="&pageReportIcon.tooltip;">
-        <menupopup onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
-          <menuitem observes="blockedPopupAllowSite"/>
-          <menuitem observes="blockedPopupEditSettings"/>
-          <menuitem observes="blockedPopupDontShowMessage"/>
-          <menuseparator observes="blockedPopupsSeparator"/>
-        </menupopup>
-      </statusbarpanel>
-    </statusbar>
+    <toolbar id="addon-bar" toolbarname="&addonBarCmd.label;" collapsed="true"
+             class="toolbar-primary chromeclass-toolbar"
+             context="toolbar-context-menu" toolboxid="navigator-toolbox"
+             mode="icons" iconsize="small" defaulticonsize="small"
+             lockiconsize="true"
+             customizable="true" align="right">
+      <statusbar id="status-bar"/>
+    </toolbar>
   </vbox>
+