Merge TM -> JM
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 01 Apr 2011 19:57:28 -0700
changeset 74883 c340841f04651a570ba8ff7e957c729f34b069db
parent 74882 baccdc943514c3cd483304476627009ae85f4196 (current diff)
parent 67904 40d6f9795ecc634fde755772d6003814255c2a8f (diff)
child 74884 215b6027c77d252e73111b744035d83645f73b76
push id20986
push userkhuey@mozilla.com
push dateSun, 14 Aug 2011 11:45:15 +0000
treeherderautoland@2de3cff973b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge TM -> JM
browser/app/apprunner-beos.rsrc
build/cygwin-wrapper
build/unix/vms/component_symvec.opt
build/unix/vms/getinfo.com
build/unix/vms/install.com
build/unix/vms/libxpcom_dbg_symvec.opt
build/unix/vms/libxpcom_symvec.opt
build/unix/vms/mozilla.com
config/make-jars.pl
content/events/test/Makefile.in
content/xml/document/public/nsIFIXptr.idl
content/xml/document/public/nsIModifyableXPointer.idl
content/xml/document/public/nsIXPointer.idl
content/xml/tests/xpointer/xpointer.xml
content/xslt/src/xpath/nsXPath1Scheme.cpp
content/xslt/src/xpath/nsXPath1Scheme.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsGlobalWindow.cpp
dom/interfaces/core/nsIDOM3Document.idl
dom/interfaces/load-save/nsIDOMDOMImplementationLS.idl
dom/interfaces/load-save/nsIDOMLSException.idl
dom/interfaces/load-save/nsIDOMLSInput.idl
dom/interfaces/load-save/nsIDOMLSLoadEvent.idl
dom/interfaces/load-save/nsIDOMLSOutput.idl
dom/interfaces/load-save/nsIDOMLSParser.idl
dom/interfaces/load-save/nsIDOMLSParserFilter.idl
dom/interfaces/load-save/nsIDOMLSResourceResolver.idl
dom/interfaces/load-save/nsIDOMLSSerializer.idl
dom/interfaces/load-save/nsIDOMLSSerializerFilter.idl
editor/idl/nsIHTMLEditor_MOZILLA_2_0_BRANCH.idl
gfx/src/thebes/nsSystemFontsBeOS.cpp
gfx/src/thebes/nsSystemFontsBeOS.h
gfx/thebes/gfxBeOSPlatform.cpp
gfx/thebes/gfxBeOSPlatform.h
gfx/thebes/gfxBeOSSurface.cpp
gfx/thebes/gfxBeOSSurface.h
intl/uconv/src/nsBeOSCharset.cpp
intl/uconv/ucvja/jis0212.uf
intl/uconv/ucvko/nsUnicodeToISO2022KR.cpp
intl/uconv/ucvko/nsUnicodeToISO2022KR.h
intl/uconv/ucvlatin/nsUnicodeToVIQR.cpp
intl/uconv/ucvlatin/nsUnicodeToVIQR.h
intl/uconv/ucvlatin/nsUnicodeToVNI.cpp
intl/uconv/ucvlatin/nsUnicodeToVNI.h
intl/uconv/ucvlatin/nsVIQRToUnicode.cpp
intl/uconv/ucvlatin/nsVIQRToUnicode.h
intl/uconv/ucvlatin/nsVNIToUnicode.cpp
intl/uconv/ucvlatin/nsVNIToUnicode.h
jpeg/cdjpeg.c
jpeg/change.log
jpeg/cjpeg.c
jpeg/ckconfig.c
jpeg/coderules.doc
jpeg/djpeg.c
jpeg/example.c
jpeg/filelist.doc
jpeg/install.doc
jpeg/jconfig-mac-cw.h
jpeg/jconfig.doc
jpeg/jconfig.wat
jpeg/jmemansi.c
jpeg/jmemdos.c
jpeg/jmemdosa.asm
jpeg/jmemname.c
jpeg/jos2fig.h
jpeg/jwinfig.h
jpeg/libjpeg.doc
jpeg/makefile.gen
jpeg/netscape_mods.doc
jpeg/structure.doc
jpeg/usage.doc
jpeg/wizard.doc
js/src/Makefile.in
js/src/build/cygwin-wrapper
js/src/config/autoconf.mk.in
js/src/configure.in
js/src/jsapi-tests/Makefile.in
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarena.h
js/src/jsarray.cpp
js/src/jsatom.cpp
js/src/jsclone.cpp
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdate.cpp
js/src/jsdbgapi.cpp
js/src/jsemit.cpp
js/src/jsexn.cpp
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsgcinlines.h
js/src/jshashtable.h
js/src/jsinfer.cpp
js/src/jsinferinlines.h
js/src/jsinterp.cpp
js/src/jsinterp.h
js/src/jsinterpinlines.h
js/src/jsiter.cpp
js/src/jsnum.cpp
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsparse.cpp
js/src/jsparse.h
js/src/jsprf.cpp
js/src/jspropertycache.cpp
js/src/jsregexp.cpp
js/src/jsregexpinlines.h
js/src/jsscope.cpp
js/src/jsscope.h
js/src/jsscopeinlines.h
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsstr.cpp
js/src/jsstrinlines.h
js/src/jstracer.cpp
js/src/jstracer.h
js/src/jstypedarray.cpp
js/src/jsxdrapi.h
js/src/jsxml.cpp
js/src/methodjit/Compiler.cpp
js/src/methodjit/FrameState.cpp
js/src/methodjit/ImmutableSync.cpp
js/src/methodjit/InvokeHelpers.cpp
js/src/methodjit/MethodJIT.cpp
js/src/methodjit/MethodJIT.h
js/src/methodjit/MonoIC.cpp
js/src/methodjit/PolyIC.cpp
js/src/methodjit/PolyIC.h
js/src/methodjit/StubCalls.cpp
js/src/methodjit/StubCalls.h
js/src/perf/jsperf.cpp
js/src/shell/Makefile.in
js/src/shell/js.cpp
js/src/tests/js1_8_5/regress/jstests.list
js/src/tests/manifest.py
js/src/xpconnect/shell/xpcshell.cpp
js/src/xpconnect/src/xpcwrappednative.cpp
layout/style/nsCSSStruct.cpp
layout/style/nsCSSStruct.h
layout/style/nsCSSStyleRule.cpp
layout/style/nsICSSImportRule.h
layout/style/nsICSSNameSpaceRule.h
layout/style/nsICSSStyleRule.h
modules/libpr0n/decoders/icon/beos/Makefile.in
modules/libpr0n/decoders/icon/beos/nsIconChannel.cpp
modules/libpr0n/decoders/icon/beos/nsIconChannel.h
modules/libpref/src/init/all.js
modules/plugin/base/src/nsPluginsDirBeOS.cpp
modules/plugin/sdk/Makefile.in
modules/plugin/sdk/readme.txt
modules/plugin/sdk/samples/Makefile.in
modules/plugin/sdk/samples/basic/mac/BasicPlugin.c
modules/plugin/sdk/samples/basic/mac/BasicPlugin.h
modules/plugin/sdk/samples/basic/mac/BasicPlugin.xcodeproj/project.pbxproj
modules/plugin/sdk/samples/basic/mac/BasicPlugin_Prefix.pch
modules/plugin/sdk/samples/basic/mac/COPYING
modules/plugin/sdk/samples/basic/mac/English.lproj/InfoPlist.strings
modules/plugin/sdk/samples/basic/mac/Info.plist
modules/plugin/sdk/samples/basic/readme.txt
modules/plugin/sdk/samples/basic/test.html
modules/plugin/sdk/samples/basic/unix/BasicPlugin.c
modules/plugin/sdk/samples/basic/unix/BasicPlugin.h
modules/plugin/sdk/samples/basic/unix/COPYING
modules/plugin/sdk/samples/basic/unix/Makefile
modules/plugin/sdk/samples/basic/windows/Makefile.in
modules/plugin/sdk/samples/basic/windows/basic.def
modules/plugin/sdk/samples/basic/windows/basic.rc
modules/plugin/sdk/samples/basic/windows/npbasic.dsp
modules/plugin/sdk/samples/basic/windows/npbasic.dsw
modules/plugin/sdk/samples/basic/windows/plugin.cpp
modules/plugin/sdk/samples/basic/windows/plugin.h
modules/plugin/sdk/samples/basic/windows/resource.h
modules/plugin/sdk/samples/common/Makefile.in
modules/plugin/sdk/samples/common/np_entry.cpp
modules/plugin/sdk/samples/common/npn_gate.cpp
modules/plugin/sdk/samples/common/npp_gate.cpp
modules/plugin/sdk/samples/include/npplat.h
modules/plugin/sdk/samples/include/pluginbase.h
modules/plugin/sdk/samples/npruntime/Makefile.in
modules/plugin/sdk/samples/npruntime/np_entry.cpp
modules/plugin/sdk/samples/npruntime/npn_gate.cpp
modules/plugin/sdk/samples/npruntime/npp_gate.cpp
modules/plugin/sdk/samples/npruntime/nprt.def
modules/plugin/sdk/samples/npruntime/nprt.rc
modules/plugin/sdk/samples/npruntime/plugin.cpp
modules/plugin/sdk/samples/npruntime/plugin.h
modules/plugin/sdk/samples/npruntime/readme.txt
modules/plugin/sdk/samples/npruntime/resource.h
modules/plugin/sdk/samples/npruntime/test.html
modules/plugin/sdk/samples/npthread/readme.txt
modules/plugin/sdk/samples/npthread/windows/action.cpp
modules/plugin/sdk/samples/npthread/windows/action.h
modules/plugin/sdk/samples/npthread/windows/dbg.cpp
modules/plugin/sdk/samples/npthread/windows/dbg.h
modules/plugin/sdk/samples/npthread/windows/np_entry.cpp
modules/plugin/sdk/samples/npthread/windows/npn_gate.cpp
modules/plugin/sdk/samples/npthread/windows/npp_gate.cpp
modules/plugin/sdk/samples/npthread/windows/npthread.def
modules/plugin/sdk/samples/npthread/windows/npthread.dsp
modules/plugin/sdk/samples/npthread/windows/npthread.dsw
modules/plugin/sdk/samples/npthread/windows/npthread.rc
modules/plugin/sdk/samples/npthread/windows/plugin.cpp
modules/plugin/sdk/samples/npthread/windows/plugin.h
modules/plugin/sdk/samples/npthread/windows/plugload.cpp
modules/plugin/sdk/samples/npthread/windows/plugload.h
modules/plugin/sdk/samples/npthread/windows/resource.h
modules/plugin/sdk/samples/npthread/windows/thread.cpp
modules/plugin/sdk/samples/npthread/windows/thread.h
modules/plugin/sdk/samples/unixprinting/Makefile.in
modules/plugin/sdk/samples/unixprinting/npshell.c
modules/plugin/sdk/samples/unixprinting/npunix.c
modules/plugin/sdk/samples/unixprinting/printplugin.c
modules/plugin/sdk/samples/unixprinting/printplugin.h
modules/plugin/sdk/samples/unixprinting/readme.txt
modules/plugin/sdk/samples/unixprinting/unixprintplugin_test1.html
modules/plugin/sdk/samples/unixprinting/unixprintplugin_test2.html
modules/plugin/sdk/samples/winless/readme.txt
modules/plugin/sdk/samples/winless/test.html
modules/plugin/sdk/samples/winless/windows/Makefile.in
modules/plugin/sdk/samples/winless/windows/npwinless.def
modules/plugin/sdk/samples/winless/windows/npwinless.dsp
modules/plugin/sdk/samples/winless/windows/npwinless.dsw
modules/plugin/sdk/samples/winless/windows/npwinless.rc
modules/plugin/sdk/samples/winless/windows/plugin.cpp
modules/plugin/sdk/samples/winless/windows/plugin.h
modules/plugin/sdk/samples/winless/windows/resource.h
toolkit/components/alerts/public/Makefile.in
toolkit/components/alerts/public/nsIAlertsService.idl
toolkit/components/alerts/public/nsINotificationsList.idl
toolkit/components/alerts/src/Makefile.in
toolkit/components/alerts/src/mac/Makefile.in
toolkit/components/alerts/src/mac/growl/CFGrowlAdditions.c
toolkit/components/alerts/src/mac/growl/CFGrowlAdditions.h
toolkit/components/alerts/src/mac/growl/CFGrowlDefines.h
toolkit/components/alerts/src/mac/growl/CFMutableDictionaryAdditions.c
toolkit/components/alerts/src/mac/growl/CFMutableDictionaryAdditions.h
toolkit/components/alerts/src/mac/growl/CFURLAdditions.c
toolkit/components/alerts/src/mac/growl/CFURLAdditions.h
toolkit/components/alerts/src/mac/growl/GrowlAbstractSingletonObject.h
toolkit/components/alerts/src/mac/growl/GrowlApplicationBridge.h
toolkit/components/alerts/src/mac/growl/GrowlApplicationBridge.m
toolkit/components/alerts/src/mac/growl/GrowlDefines.h
toolkit/components/alerts/src/mac/growl/GrowlDefinesInternal.h
toolkit/components/alerts/src/mac/growl/GrowlPathUtilities.h
toolkit/components/alerts/src/mac/growl/GrowlPathUtilities.m
toolkit/components/alerts/src/mac/growl/GrowlPathway.h
toolkit/components/alerts/src/mac/growl/GrowlPreferencesController.h
toolkit/components/alerts/src/mac/growl/GrowlTicketController.h
toolkit/components/alerts/src/mac/growl/Makefile.in
toolkit/components/alerts/src/mac/growl/license.txt
toolkit/components/alerts/src/mac/mozGrowlDelegate.h
toolkit/components/alerts/src/mac/mozGrowlDelegate.mm
toolkit/components/alerts/src/mac/nsAlertsImageLoadListener.h
toolkit/components/alerts/src/mac/nsAlertsImageLoadListener.mm
toolkit/components/alerts/src/mac/nsAlertsService.h
toolkit/components/alerts/src/mac/nsAlertsService.mm
toolkit/components/alerts/src/mac/nsAlertsServiceModule.cpp
toolkit/components/alerts/src/mac/nsNotificationsList.h
toolkit/components/alerts/src/mac/nsNotificationsList.mm
toolkit/components/alerts/src/nsAlertsService.cpp
toolkit/components/alerts/src/nsAlertsService.h
toolkit/components/autocomplete/public/Makefile.in
toolkit/components/autocomplete/public/nsIAutoCompleteController.idl
toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl
toolkit/components/autocomplete/public/nsIAutoCompletePopup.idl
toolkit/components/autocomplete/public/nsIAutoCompleteResult.idl
toolkit/components/autocomplete/public/nsIAutoCompleteSearch.idl
toolkit/components/autocomplete/public/nsIAutoCompleteSimpleResult.idl
toolkit/components/autocomplete/src/Makefile.in
toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
toolkit/components/autocomplete/src/nsAutoCompleteController.h
toolkit/components/autocomplete/src/nsAutoCompleteSimpleResult.cpp
toolkit/components/autocomplete/src/nsAutoCompleteSimpleResult.h
toolkit/components/commandlines/public/Makefile.in
toolkit/components/commandlines/public/nsICommandLine.idl
toolkit/components/commandlines/public/nsICommandLineHandler.idl
toolkit/components/commandlines/public/nsICommandLineRunner.idl
toolkit/components/commandlines/public/nsICommandLineValidator.idl
toolkit/components/commandlines/src/Makefile.in
toolkit/components/commandlines/src/nsCommandLine.cpp
toolkit/components/contentprefs/src/Makefile.in
toolkit/components/contentprefs/src/nsContentPrefService.js
toolkit/components/contentprefs/src/nsContentPrefService.manifest
toolkit/components/downloads/public/Makefile.in
toolkit/components/downloads/public/nsIDownload.idl
toolkit/components/downloads/public/nsIDownloadManager.idl
toolkit/components/downloads/public/nsIDownloadManagerUI.idl
toolkit/components/downloads/public/nsIDownloadProgressListener.idl
toolkit/components/downloads/src/Makefile.in
toolkit/components/downloads/src/nsDownloadManager.cpp
toolkit/components/downloads/src/nsDownloadManager.h
toolkit/components/downloads/src/nsDownloadManagerUI.js
toolkit/components/downloads/src/nsDownloadManagerUI.manifest
toolkit/components/downloads/src/nsDownloadProxy.h
toolkit/components/downloads/src/nsDownloadScanner.cpp
toolkit/components/downloads/src/nsDownloadScanner.h
toolkit/components/feeds/public/Makefile.in
toolkit/components/feeds/public/nsIFeed.idl
toolkit/components/feeds/public/nsIFeedContainer.idl
toolkit/components/feeds/public/nsIFeedElementBase.idl
toolkit/components/feeds/public/nsIFeedEntry.idl
toolkit/components/feeds/public/nsIFeedGenerator.idl
toolkit/components/feeds/public/nsIFeedListener.idl
toolkit/components/feeds/public/nsIFeedPerson.idl
toolkit/components/feeds/public/nsIFeedProcessor.idl
toolkit/components/feeds/public/nsIFeedResult.idl
toolkit/components/feeds/public/nsIFeedTextConstruct.idl
toolkit/components/feeds/public/nsIScriptableUnescapeHTML.idl
toolkit/components/feeds/src/FeedProcessor.js
toolkit/components/feeds/src/FeedProcessor.manifest
toolkit/components/feeds/src/Makefile.in
toolkit/components/feeds/src/nsScriptableUnescapeHTML.cpp
toolkit/components/feeds/src/nsScriptableUnescapeHTML.h
toolkit/components/filepicker/public/Makefile.in
toolkit/components/filepicker/public/nsIFileView.idl
toolkit/components/filepicker/src/Makefile.in
toolkit/components/filepicker/src/nsFilePicker.js
toolkit/components/filepicker/src/nsFilePicker.manifest
toolkit/components/filepicker/src/nsFileView.cpp
toolkit/components/find/public/Makefile.in
toolkit/components/find/public/nsIFindService.idl
toolkit/components/find/src/Makefile.in
toolkit/components/find/src/nsFindService.cpp
toolkit/components/find/src/nsFindService.h
toolkit/components/microformats/src/Makefile.in
toolkit/components/microformats/src/Microformats.js
toolkit/components/parentalcontrols/public/Makefile.in
toolkit/components/parentalcontrols/public/nsIParentalControlsService.idl
toolkit/components/parentalcontrols/src/Makefile.in
toolkit/components/parentalcontrols/src/nsParentalControlsServiceWin.cpp
toolkit/components/parentalcontrols/src/nsParentalControlsServiceWin.h
toolkit/components/passwordmgr/public/Makefile.in
toolkit/components/passwordmgr/public/nsILoginInfo.idl
toolkit/components/passwordmgr/public/nsILoginManager.idl
toolkit/components/passwordmgr/public/nsILoginManagerCrypto.idl
toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl
toolkit/components/passwordmgr/public/nsILoginManagerPrompter.idl
toolkit/components/passwordmgr/public/nsILoginManagerStorage.idl
toolkit/components/passwordmgr/public/nsILoginMetaInfo.idl
toolkit/components/passwordmgr/src/Makefile.in
toolkit/components/passwordmgr/src/crypto-SDR.js
toolkit/components/passwordmgr/src/nsLoginInfo.js
toolkit/components/passwordmgr/src/nsLoginManager.js
toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js
toolkit/components/passwordmgr/src/passwordmgr.manifest
toolkit/components/passwordmgr/src/storage-Legacy.js
toolkit/components/passwordmgr/src/storage-mozStorage.js
toolkit/components/places/public/Makefile.in
toolkit/components/places/public/mozIAsyncHistory.idl
toolkit/components/places/public/mozIPlacesAutoComplete.idl
toolkit/components/places/public/nsIAnnotationService.idl
toolkit/components/places/public/nsIBrowserHistory.idl
toolkit/components/places/public/nsIDynamicContainer.idl
toolkit/components/places/public/nsIFaviconService.idl
toolkit/components/places/public/nsILivemarkService.idl
toolkit/components/places/public/nsIMicrosummaryService.idl
toolkit/components/places/public/nsINavBookmarksService.idl
toolkit/components/places/public/nsINavHistoryService.idl
toolkit/components/places/public/nsIPlacesImportExportService.idl
toolkit/components/places/public/nsITaggingService.idl
toolkit/components/places/public/nsPIPlacesDatabase.idl
toolkit/components/places/public/nsPIPlacesHistoryListenersNotifier.idl
toolkit/components/places/src/AsyncFaviconHelpers.cpp
toolkit/components/places/src/AsyncFaviconHelpers.h
toolkit/components/places/src/Helpers.cpp
toolkit/components/places/src/Helpers.h
toolkit/components/places/src/History.cpp
toolkit/components/places/src/History.h
toolkit/components/places/src/Makefile.in
toolkit/components/places/src/PlaceInfo.cpp
toolkit/components/places/src/PlaceInfo.h
toolkit/components/places/src/PlacesCategoriesStarter.js
toolkit/components/places/src/PlacesDBUtils.jsm
toolkit/components/places/src/PlacesUtils.jsm
toolkit/components/places/src/SQLFunctions.cpp
toolkit/components/places/src/SQLFunctions.h
toolkit/components/places/src/VisitInfo.cpp
toolkit/components/places/src/VisitInfo.h
toolkit/components/places/src/nsAnnoProtocolHandler.cpp
toolkit/components/places/src/nsAnnoProtocolHandler.h
toolkit/components/places/src/nsAnnotationService.cpp
toolkit/components/places/src/nsAnnotationService.h
toolkit/components/places/src/nsFaviconService.cpp
toolkit/components/places/src/nsFaviconService.h
toolkit/components/places/src/nsLivemarkService.js
toolkit/components/places/src/nsMaybeWeakPtr.cpp
toolkit/components/places/src/nsMaybeWeakPtr.h
toolkit/components/places/src/nsMicrosummaryService.js
toolkit/components/places/src/nsMorkHistoryImporter.cpp
toolkit/components/places/src/nsNavBookmarks.cpp
toolkit/components/places/src/nsNavBookmarks.h
toolkit/components/places/src/nsNavHistory.cpp
toolkit/components/places/src/nsNavHistory.h
toolkit/components/places/src/nsNavHistoryQuery.cpp
toolkit/components/places/src/nsNavHistoryQuery.h
toolkit/components/places/src/nsNavHistoryResult.cpp
toolkit/components/places/src/nsNavHistoryResult.h
toolkit/components/places/src/nsPlacesAutoComplete.js
toolkit/components/places/src/nsPlacesAutoComplete.manifest
toolkit/components/places/src/nsPlacesExpiration.js
toolkit/components/places/src/nsPlacesImportExportService.cpp
toolkit/components/places/src/nsPlacesImportExportService.h
toolkit/components/places/src/nsPlacesIndexes.h
toolkit/components/places/src/nsPlacesMacros.h
toolkit/components/places/src/nsPlacesModule.cpp
toolkit/components/places/src/nsPlacesTables.h
toolkit/components/places/src/nsPlacesTriggers.h
toolkit/components/places/src/nsTaggingService.js
toolkit/components/places/src/toolkitplaces.manifest
toolkit/components/places/src/utils.js
toolkit/components/satchel/public/Makefile.in
toolkit/components/satchel/public/nsIFormAutoComplete.idl
toolkit/components/satchel/public/nsIFormFillController.idl
toolkit/components/satchel/public/nsIFormHistory.idl
toolkit/components/satchel/public/nsIInputListAutoComplete.idl
toolkit/components/satchel/src/Makefile.in
toolkit/components/satchel/src/formSubmitListener.js
toolkit/components/satchel/src/nsFormAutoComplete.js
toolkit/components/satchel/src/nsFormAutoCompleteResult.jsm
toolkit/components/satchel/src/nsFormFillController.cpp
toolkit/components/satchel/src/nsFormFillController.h
toolkit/components/satchel/src/nsFormHistory.js
toolkit/components/satchel/src/nsInputListAutoComplete.js
toolkit/components/satchel/src/satchel.manifest
toolkit/components/startup/src/Makefile.in
toolkit/components/startup/src/nsAppStartup.cpp
toolkit/components/startup/src/nsAppStartup.h
toolkit/components/startup/src/nsTryToClose.js
toolkit/components/startup/src/nsTryToClose.manifest
toolkit/components/startup/src/nsUserInfo.h
toolkit/components/startup/src/nsUserInfoMac.h
toolkit/components/startup/src/nsUserInfoMac.mm
toolkit/components/startup/src/nsUserInfoOS2.cpp
toolkit/components/startup/src/nsUserInfoUnix.cpp
toolkit/components/startup/src/nsUserInfoWin.cpp
toolkit/components/typeaheadfind/public/Makefile.in
toolkit/components/typeaheadfind/public/nsITypeAheadFind.idl
toolkit/components/typeaheadfind/src/Makefile.in
toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp
toolkit/components/typeaheadfind/src/nsTypeAheadFind.h
toolkit/components/url-classifier/public/Makefile.in
toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl
toolkit/components/url-classifier/public/nsIUrlClassifierHashCompleter.idl
toolkit/components/url-classifier/public/nsIUrlClassifierStreamUpdater.idl
toolkit/components/url-classifier/public/nsIUrlClassifierTable.idl
toolkit/components/url-classifier/public/nsIUrlClassifierUtils.idl
toolkit/components/url-classifier/public/nsIUrlListManager.idl
toolkit/components/url-classifier/src/Makefile.in
toolkit/components/url-classifier/src/nsURLClassifier.manifest
toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/src/nsUrlClassifierDBService.h
toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp
toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h
toolkit/components/url-classifier/src/nsUrlClassifierLib.js
toolkit/components/url-classifier/src/nsUrlClassifierListManager.js
toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp
toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h
toolkit/components/url-classifier/src/nsUrlClassifierUtils.cpp
toolkit/components/url-classifier/src/nsUrlClassifierUtils.h
toolkit/components/urlformatter/public/Makefile.in
toolkit/components/urlformatter/public/nsIURLFormatter.idl
toolkit/components/urlformatter/src/Makefile.in
toolkit/components/urlformatter/src/nsURLFormatter.js
toolkit/components/urlformatter/src/nsURLFormatter.manifest
toolkit/crashreporter/google-breakpad/src/client/mac/gcov/libgcov.a
toolkit/crashreporter/google-breakpad/src/third_party/linux/lib/gflags/libgflags.a
toolkit/crashreporter/google-breakpad/src/third_party/linux/lib/glog/libglog.a
toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.o
toolkit/mozapps/Makefile.in
toolkit/mozapps/jar.mn
toolkit/profile/public/Makefile.in
toolkit/profile/public/nsIProfileMigrator.idl
toolkit/profile/public/nsIToolkitProfile.idl
toolkit/profile/public/nsIToolkitProfileService.idl
toolkit/profile/src/Makefile.in
toolkit/profile/src/nsToolkitProfileService.cpp
toolkit/xre/nsNativeAppSupportBeOS.cpp
uriloader/exthandler/beos/nsMIMEInfoBeOS.cpp
uriloader/exthandler/beos/nsMIMEInfoBeOS.h
uriloader/exthandler/beos/nsOSHelperAppService.cpp
uriloader/exthandler/beos/nsOSHelperAppService.h
widget/public/nsIDragSessionBeOS.h
widget/src/beos/Makefile.in
widget/src/beos/nsAppShell.cpp
widget/src/beos/nsAppShell.h
widget/src/beos/nsBeOSCursors.h
widget/src/beos/nsBidiKeyboard.cpp
widget/src/beos/nsBidiKeyboard.h
widget/src/beos/nsCList.h
widget/src/beos/nsChildView.cpp
widget/src/beos/nsChildView.h
widget/src/beos/nsClipboard.cpp
widget/src/beos/nsClipboard.h
widget/src/beos/nsDeviceContextSpecB.cpp
widget/src/beos/nsDeviceContextSpecB.h
widget/src/beos/nsDragService.cpp
widget/src/beos/nsDragService.h
widget/src/beos/nsFilePicker.cpp
widget/src/beos/nsFilePicker.h
widget/src/beos/nsLookAndFeel.cpp
widget/src/beos/nsLookAndFeel.h
widget/src/beos/nsPopupWindow.cpp
widget/src/beos/nsPopupWindow.h
widget/src/beos/nsPrintOptionsBeOS.cpp
widget/src/beos/nsPrintOptionsBeOS.h
widget/src/beos/nsPrintdBeOS.h
widget/src/beos/nsScreenBeOS.cpp
widget/src/beos/nsScreenBeOS.h
widget/src/beos/nsScreenManagerBeOS.cpp
widget/src/beos/nsScreenManagerBeOS.h
widget/src/beos/nsSound.cpp
widget/src/beos/nsSound.h
widget/src/beos/nsSwitchToUIThread.h
widget/src/beos/nsToolkit.cpp
widget/src/beos/nsToolkit.h
widget/src/beos/nsWidgetFactory.cpp
widget/src/beos/nsWindow.cpp
widget/src/beos/nsWindow.h
widget/src/beos/nsdefs.h
widget/src/beos/resource.h
xpcom/glue/standalone/nsGlueLinkingBeOS.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_openvms_alpha.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_openvms_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_openvms_alpha.s
xpcom/reflect/xptcall/src/md/unix/xptcstubs_openvms_alpha.cpp
xpcom/reflect/xptcall/src/md/win32/xptcinvoke_alpha.cpp
xpcom/reflect/xptcall/src/md/win32/xptcinvoke_asm_alpha.s
xpcom/reflect/xptcall/src/md/win32/xptcstubs_alpha.cpp
xpcom/reflect/xptcall/src/md/win32/xptcstubs_asm_alpha.s
--- a/.hgtags
+++ b/.hgtags
@@ -50,8 +50,10 @@ 138f593553b66c9f815e8f57870c19d6347f7702
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R10
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R11
 0327e126ea245112c0aa7283fee154e084866fb5 bsmedberg-static-xpcom-registration-base
 0327e126ea245112c0aa7283fee154e084866fb5 bsmedberg-static-xpcom-registration-base
 2f83edbbeef0de7dd901411d270da61106c8afae bsmedberg-static-xpcom-registration-base
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R12
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R13
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R11_1_MU
+e56ecd8b3a68c158025207c5fd081d043e28f5ce GECKO_2_0_BASE
+e273946b74c8d631ed86bd74ba9afe0e67b12378 GECKO_2_1_BASE
--- a/Makefile.in
+++ b/Makefile.in
@@ -78,17 +78,17 @@ ifdef COMPILE_ENVIRONMENT
 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
 endif
 
 
 include $(topsrcdir)/config/config.mk
 
 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
-   dependencies.beos config/autoconf.mk \
+   config/autoconf.mk \
    unallmakefiles mozilla-config.h \
    netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
    $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
 
 ifdef WINCE
 check::
 	$(PYTHON) $(topsrcdir)/build/mobile/devicemanager-utils.py copy $(DIST)/bin
 endif
@@ -129,24 +129,20 @@ endif
 include $(topsrcdir)/config/rules.mk
 
 distclean::
 	cat unallmakefiles | $(XARGS) rm -f
 	rm -f unallmakefiles $(DIST_GARBAGE)
 
 ifeq ($(OS_ARCH),WINNT)
 # we want to copy PDB files on Windows
-MAKE_SYM_STORE_ARGS := -c
+MAKE_SYM_STORE_ARGS := -c --vcs-info
 ifdef PDBSTR_PATH
 MAKE_SYM_STORE_ARGS += -i
 endif
-ifeq (,$(CYGWIN_WRAPPER))
-# this doesn't work with Cygwin Python
-MAKE_SYM_STORE_ARGS += --vcs-info
-endif
 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).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 "i386 x86_64" --vcs-info
@@ -171,16 +167,19 @@ ifdef MOZ_SYMBOLS_EXTRA_BUILDID
 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
 endif
 
 export SYMBOL_INDEX_NAME = \
   $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
 
 buildsymbols:
 ifdef MOZ_CRASHREPORTER
+ifdef USE_ELF_HACK
+	$(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
+endif
 	echo building symbol store
 	$(RM) -rf $(DIST)/crashreporter-symbols
 	$(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
 	$(NSINSTALL) -D $(DIST)/crashreporter-symbols
 	$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
 	  $(MAKE_SYM_STORE_ARGS)                                          \
 	  $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir))               \
 	  $(DUMP_SYMS_BIN)                                                \
--- a/accessible/src/Makefile.in
+++ b/accessible/src/Makefile.in
@@ -69,13 +69,8 @@ ifdef MOZ_XUL
 DIRS +=   xul
 endif
 
 ifndef DISABLE_XFORMS_HOOKS
 DIRS +=   xforms
 endif
 
 include $(topsrcdir)/config/rules.mk
-
-GARBAGE += $(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX)  $(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX).fake
-
-libs::
-	$(INSTALL) $(PLATFORM_DIR)/$(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX) $(wildcard $(PLATFORM_DIR)/$(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX).fake) .
--- a/accessible/src/atk/Makefile.in
+++ b/accessible/src/atk/Makefile.in
@@ -38,16 +38,17 @@ DEPTH = ../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = accessibility
 LIBRARY_NAME = accessibility_toolkit_s
+EXPORT_LIBRARY = ..
 LIBXUL_LIBRARY = 1
 
 
 CPPSRCS = \
   nsAccessNodeWrap.cpp \
   nsAccessibleWrap.cpp \
   nsDocAccessibleWrap.cpp \
   nsRootAccessibleWrap.cpp \
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -1267,16 +1267,37 @@ nsAccessibleWrap::FirePlatformEvent(AccE
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_DEACTIVATED\n"));
         nsRootAccessible *rootAcc =
           static_cast<nsRootAccessible *>(accessible);
         rootAcc->mActivated = PR_FALSE;
         guint id = g_signal_lookup ("deactivate", MAI_TYPE_ATK_OBJECT);
         g_signal_emit(atkObj, id, 0);
       } break;
 
+    case nsIAccessibleEvent::EVENT_WINDOW_MAXIMIZE:
+      {
+        MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_MAXIMIZE\n"));
+        guint id = g_signal_lookup ("maximize", MAI_TYPE_ATK_OBJECT);
+        g_signal_emit(atkObj, id, 0);
+      } break;
+
+    case nsIAccessibleEvent::EVENT_WINDOW_MINIMIZE:
+      {
+        MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_MINIMIZE\n"));
+        guint id = g_signal_lookup ("minimize", MAI_TYPE_ATK_OBJECT);
+        g_signal_emit(atkObj, id, 0);
+      } break;
+
+    case nsIAccessibleEvent::EVENT_WINDOW_RESTORE:
+      {
+        MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_RESTORE\n"));
+        guint id = g_signal_lookup ("restore", MAI_TYPE_ATK_OBJECT);
+        g_signal_emit(atkObj, id, 0);
+      } break;
+
     case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
       {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_DOCUMENT_LOAD_COMPLETE\n"));
         g_signal_emit_by_name (atkObj, "load_complete");
       } break;
 
     case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
       {
--- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp
+++ b/accessible/src/atk/nsApplicationAccessibleWrap.cpp
@@ -213,16 +213,34 @@ mai_util_get_type(void)
         };
 
         type = g_type_register_static(ATK_TYPE_UTIL,
                                       "MaiUtil", &tinfo, GTypeFlags(0));
     }
     return type;
 }
 
+static void
+window_added (AtkObject *atk_obj,
+              guint     index,
+              AtkObject *child)
+{
+  guint id =  g_signal_lookup ("create", MAI_TYPE_ATK_OBJECT);
+  g_signal_emit (child, id, 0);
+}
+
+static void
+window_removed (AtkObject *atk_obj,
+                guint     index,
+                AtkObject *child)
+{
+  guint id =  g_signal_lookup ("destroy", MAI_TYPE_ATK_OBJECT);
+  g_signal_emit (child, id, 0);
+}
+
 /* intialize the the atk interface (function pointers) with MAI implementation.
  * When atk bridge get loaded, these interface can be used.
  */
 static void
 mai_util_class_init(MaiUtilClass *klass)
 {
     AtkUtilClass *atk_class;
     gpointer data;
@@ -243,16 +261,20 @@ mai_util_class_init(MaiUtilClass *klass)
     atk_class->add_key_event_listener = mai_util_add_key_event_listener;
     atk_class->remove_key_event_listener = mai_util_remove_key_event_listener;
     atk_class->get_root = mai_util_get_root;
     atk_class->get_toolkit_name = mai_util_get_toolkit_name;
     atk_class->get_toolkit_version = mai_util_get_toolkit_version;
 
     listener_list = g_hash_table_new_full(g_int_hash, g_int_equal, NULL,
                                           _listener_info_destroy);
+    // Keep track of added/removed windows.
+    AtkObject *root = atk_get_root ();
+    g_signal_connect (root, "children-changed::add", (GCallback) window_added, NULL);
+    g_signal_connect (root, "children-changed::remove", (GCallback) window_removed, NULL);
 }
 
 static guint
 mai_util_add_global_event_listener(GSignalEmissionHook listener,
                                    const gchar *event_type)
 {
     guint rc = 0;
     gchar **split_string;
--- a/accessible/src/base/NotificationController.cpp
+++ b/accessible/src/base/NotificationController.cpp
@@ -299,20 +299,20 @@ NotificationController::WillRefresh(mozi
   events.SwapElements(mEvents);
 
   PRUint32 eventCount = events.Length();
   for (PRUint32 idx = 0; idx < eventCount; idx++) {
     AccEvent* accEvent = events[idx];
     if (accEvent->mEventRule != AccEvent::eDoNotEmit) {
       mDocument->ProcessPendingEvent(accEvent);
 
-      AccMutationEvent* showOrhideEvent = downcast_accEvent(accEvent);
-      if (showOrhideEvent) {
-        if (showOrhideEvent->mTextChangeEvent)
-          mDocument->ProcessPendingEvent(showOrhideEvent->mTextChangeEvent);
+      AccMutationEvent* showOrHideEvent = downcast_accEvent(accEvent);
+      if (showOrHideEvent) {
+        if (showOrHideEvent->mTextChangeEvent)
+          mDocument->ProcessPendingEvent(showOrHideEvent->mTextChangeEvent);
       }
     }
     if (!mDocument)
       return;
   }
 
   // Stop further processing if there are no newly queued insertions,
   // notifications or events.
--- a/accessible/src/base/TextUpdater.cpp
+++ b/accessible/src/base/TextUpdater.cpp
@@ -65,17 +65,20 @@ TextUpdater::Run(nsDocAccessible* aDocum
   }
 }
 
 void
 TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
                       PRUint32 aSkipStart)
 {
   nsAccessible* parent = mTextLeaf->GetParent();
-  NS_ASSERTION(parent, "No parent for text leaf!");
+  if (!parent) {
+    NS_ERROR("No parent for text leaf!");
+    return;
+  }
 
   mHyperText = parent->AsHyperText();
   if (!mHyperText) {
     NS_ERROR("Text leaf parent is not hypertext!");
     return;
   }
 
   // Get the text leaf accessible offset and invalidate cached offsets after it.
--- a/accessible/src/base/nsAccUtils.h
+++ b/accessible/src/base/nsAccUtils.h
@@ -370,26 +370,16 @@ public:
   {
     PRUint32 role = Role(aAcc);
     return role != nsIAccessibleRole::ROLE_TEXT_LEAF &&
            role != nsIAccessibleRole::ROLE_WHITESPACE &&
            role != nsIAccessibleRole::ROLE_STATICTEXT;
   }
 
   /**
-   * Return true if the given accessible hasn't children.
-   */
-  static inline PRBool IsLeaf(nsIAccessible *aAcc)
-  {
-    PRInt32 numChildren = 0;
-    aAcc->GetChildCount(&numChildren);
-    return numChildren == 0;
-  }
-
-  /**
    * Return true if the given accessible can't have children. Used when exposing
    * to platform accessibility APIs, should the children be pruned off?
    */
   static PRBool MustPrune(nsIAccessible *aAccessible);
 
   /**
    * Search hint enum constants. Used by GetHeaderCellsFor() method.
    */
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -95,16 +95,17 @@
 #endif
 
 #ifndef DISABLE_XFORMS_HOOKS
 #include "nsXFormsFormControlsAccessible.h"
 #include "nsXFormsWidgetsAccessible.h"
 #endif
 
 #include "mozilla/FunctionTimer.h"
+#include "mozilla/dom/Element.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService
 ////////////////////////////////////////////////////////////////////////////////
 
 nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nsnull;
 PRBool nsAccessibilityService::gIsShutdown = PR_TRUE;
 
@@ -270,17 +271,17 @@ nsAccessibilityService::CreateHTMLImageA
   if (htmlDoc) {
     nsAutoString mapElmName;
     aContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::usemap,
                       mapElmName);
 
     if (!mapElmName.IsEmpty()) {
       if (mapElmName.CharAt(0) == '#')
         mapElmName.Cut(0,1);
-      mapElm = htmlDoc->GetImageMap(mapElmName);
+      mapElm = do_QueryInterface(htmlDoc->GetImageMap(mapElmName));
     }
   }
 
   nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
   nsAccessible* accessible = mapElm ?
     new nsHTMLImageMapAccessible(aContent, weakShell, mapElm) :
     new nsHTMLImageAccessibleWrap(aContent, weakShell);
   NS_IF_ADDREF(accessible);
@@ -533,16 +534,32 @@ nsAccessibilityService::UpdateText(nsIPr
                                    nsIContent* aContent)
 {
   nsDocAccessible* document = GetDocAccessible(aPresShell->GetDocument());
   if (document)
     document->UpdateText(aContent);
 }
 
 void
+nsAccessibilityService::UpdateListBullet(nsIPresShell* aPresShell,
+                                         nsIContent* aHTMLListItemContent,
+                                         bool aHasBullet)
+{
+  nsDocAccessible* document = GetDocAccessible(aPresShell->GetDocument());
+  if (document) {
+    nsAccessible* accessible = document->GetAccessible(aHTMLListItemContent);
+    if (accessible) {
+      nsHTMLLIAccessible* listItem = accessible->AsHTMLListItem();
+      if (listItem)
+        listItem->UpdateBullet(aHasBullet);
+    }
+  }
+}
+
+void
 nsAccessibilityService::PresShellDestroyed(nsIPresShell *aPresShell)
 {
   // Presshell destruction will automatically destroy shells for descendant
   // documents, so no need to worry about those. Just shut down the accessible
   // for this one document. That keeps us from having bad behavior in case of
   // deep bushy subtrees.
   // When document subtree containing iframe is hidden then we don't get
   // pagehide event for the iframe's underlying document and its presshell is
--- a/accessible/src/base/nsAccessibilityService.h
+++ b/accessible/src/base/nsAccessibilityService.h
@@ -115,16 +115,23 @@ public:
                                     nsIContent* aStartChild,
                                     nsIContent* aEndChild);
 
   virtual void ContentRemoved(nsIPresShell* aPresShell, nsIContent* aContainer,
                               nsIContent* aChild);
 
   virtual void UpdateText(nsIPresShell* aPresShell, nsIContent* aContent);
 
+  /**
+   * Update list bullet accessible.
+   */
+  virtual void UpdateListBullet(nsIPresShell* aPresShell,
+                                nsIContent* aHTMLListItemContent,
+                                bool aHasBullet);
+
   virtual void NotifyOfAnchorJumpTo(nsIContent *aTarget);
 
   virtual void PresShellDestroyed(nsIPresShell* aPresShell);
 
   /**
    * Notify that presshell is activated.
    */
   virtual void PresShellActivated(nsIPresShell* aPresShell);
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -760,70 +760,64 @@ nsAccessible::GetFocusedChild(nsIAccessi
       focusedChild = nsnull;
   }
 
   NS_IF_ADDREF(*aFocusedChild = focusedChild);
   return NS_OK;
 }
 
 // nsAccessible::GetChildAtPoint()
-nsresult
-nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild,
-                              nsIAccessible **aChild)
+nsAccessible*
+nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                              EWhichChildAtPoint aWhichChild)
 {
   // If we can't find the point in a child, we will return the fallback answer:
   // we return |this| if the point is within it, otherwise nsnull.
   PRInt32 x = 0, y = 0, width = 0, height = 0;
   nsresult rv = GetBounds(&x, &y, &width, &height);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIAccessible> fallbackAnswer;
+  NS_ENSURE_SUCCESS(rv, nsnull);
+
+  nsAccessible* fallbackAnswer = nsnull;
   if (aX >= x && aX < x + width && aY >= y && aY < y + height)
     fallbackAnswer = this;
 
-  if (nsAccUtils::MustPrune(this)) {  // Do not dig any further
-    NS_IF_ADDREF(*aChild = fallbackAnswer);
-    return NS_OK;
-  }
+  if (nsAccUtils::MustPrune(this))  // Do not dig any further
+    return fallbackAnswer;
 
   // Search an accessible at the given point starting from accessible document
   // because containing block (see CSS2) for out of flow element (for example,
   // absolutely positioned element) may be different from its DOM parent and
   // therefore accessible for containing block may be different from accessible
   // for DOM parent but GetFrameForPoint() should be called for containing block
   // to get an out of flow element.
   nsDocAccessible *accDocument = GetDocAccessible();
-  NS_ENSURE_TRUE(accDocument, NS_ERROR_FAILURE);
+  NS_ENSURE_TRUE(accDocument, nsnull);
 
   nsIFrame *frame = accDocument->GetFrame();
-  NS_ENSURE_STATE(frame);
+  NS_ENSURE_TRUE(frame, nsnull);
 
   nsPresContext *presContext = frame->PresContext();
 
   nsIntRect screenRect = frame->GetScreenRectExternal();
   nsPoint offset(presContext->DevPixelsToAppUnits(aX - screenRect.x),
                  presContext->DevPixelsToAppUnits(aY - screenRect.y));
 
   nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
   nsIFrame *foundFrame = presShell->GetFrameForPoint(frame, offset);
 
   nsIContent* content = nsnull;
-  if (!foundFrame || !(content = foundFrame->GetContent())) {
-    NS_IF_ADDREF(*aChild = fallbackAnswer);
-    return NS_OK;
-  }
+  if (!foundFrame || !(content = foundFrame->GetContent()))
+    return fallbackAnswer;
 
   // Get accessible for the node with the point or the first accessible in
   // the DOM parent chain.
   nsAccessible* accessible =
    GetAccService()->GetAccessibleOrContainer(content, mWeakShell);
-  if (!accessible) {
-    NS_IF_ADDREF(*aChild = fallbackAnswer);
-    return NS_OK;
-  }
+  if (!accessible)
+    return fallbackAnswer;
 
   if (accessible == this) {
     // Manually walk through accessible children and see if the are within this
     // point. Skip offscreen or invisible accessibles. This takes care of cases
     // where layout won't walk into things for us, such as image map areas and
     // sub documents (XXX: subdocuments should be handled by methods of
     // nsOuterDocAccessibles).
     PRInt32 childCount = GetChildCount();
@@ -831,78 +825,76 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
       nsAccessible *child = GetChildAt(childIdx);
 
       PRInt32 childX, childY, childWidth, childHeight;
       child->GetBounds(&childX, &childY, &childWidth, &childHeight);
       if (aX >= childX && aX < childX + childWidth &&
           aY >= childY && aY < childY + childHeight &&
           (nsAccUtils::State(child) & nsIAccessibleStates::STATE_INVISIBLE) == 0) {
 
-        if (aDeepestChild)
-          return child->GetDeepestChildAtPoint(aX, aY, aChild);
-
-        NS_IF_ADDREF(*aChild = child);
-        return NS_OK;
+        if (aWhichChild == eDeepestChild)
+          return child->GetChildAtPoint(aX, aY, eDeepestChild);
+
+        return child;
       }
     }
 
     // The point is in this accessible but not in a child. We are allowed to
     // return |this| as the answer.
-    NS_IF_ADDREF(*aChild = accessible);
-    return NS_OK;
+    return accessible;
   }
 
   // Since DOM node of obtained accessible may be out of flow then we should
   // ensure obtained accessible is a child of this accessible.
-  nsCOMPtr<nsIAccessible> parent, child(accessible);
-  while (PR_TRUE) {
-    child->GetParent(getter_AddRefs(parent));
+  nsAccessible* child = accessible;
+  while (true) {
+    nsAccessible* parent = child->GetParent();
     if (!parent) {
       // Reached the top of the hierarchy. These bounds were inside an
       // accessible that is not a descendant of this one.
-      NS_IF_ADDREF(*aChild = fallbackAnswer);      
-      return NS_OK;
+      return fallbackAnswer;
     }
 
-    if (parent == this) {
-      NS_ADDREF(*aChild = (aDeepestChild ? accessible : child));
-      return NS_OK;
-    }
-    child.swap(parent);
+    if (parent == this)
+      return aWhichChild == eDeepestChild ? accessible : child;
+
+    child = parent;
   }
 
-  return NS_OK;
+  return nsnull;
 }
 
 // nsIAccessible getChildAtPoint(in long x, in long y)
 NS_IMETHODIMP
 nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                               nsIAccessible **aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  return GetChildAtPoint(aX, aY, PR_FALSE, aAccessible);
+  NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDirectChild));
+  return NS_OK;
 }
 
 // nsIAccessible getDeepestChildAtPoint(in long x, in long y)
 NS_IMETHODIMP
 nsAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
                                      nsIAccessible **aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  return GetChildAtPoint(aX, aY, PR_TRUE, aAccessible);
+  NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDeepestChild));
+  return NS_OK;
 }
 
 void nsAccessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame)
 {
 /*
  * This method is used to determine the bounds of a content node.
  * Because HTML wraps and links are not always rectangular, this
  * method uses the following algorithm:
@@ -2711,17 +2703,17 @@ nsAccessible::GetNameInternal(nsAString&
 void
 nsAccessible::BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent)
 {
   NS_PRECONDITION(aParent, "This method isn't used to set null parent!");
 
   if (mParent) {
     if (mParent != aParent) {
       NS_ERROR("Adopting child!");
-      mParent->InvalidateChildren();
+      mParent->RemoveChild(this);
     } else {
       NS_ERROR("Binding to the same parent!");
       return;
     }
   }
 
   mParent = aParent;
   mIndexInParent = aIndexInParent;
@@ -3223,25 +3215,47 @@ nsAccessible::GetSiblingAtOffset(PRInt32
     *aError = NS_ERROR_UNEXPECTED;
 
   return child;
 }
 
 nsAccessible *
 nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
 {
-  nsAccessible *accessible =
+  nsAccessible* accessible =
     GetAccService()->GetAccessibleInWeakShell(aStartNode, mWeakShell);
   if (accessible)
     return accessible;
 
-  nsIContent *content = nsCoreUtils::GetRoleContent(aStartNode);
-  nsAccTreeWalker walker(mWeakShell, content, PR_FALSE);
-  nsRefPtr<nsAccessible> childAccessible = walker.GetNextChild();
-  return childAccessible;
+  nsCOMPtr<nsIDOMDocumentTraversal> trav =
+    do_QueryInterface(aStartNode->GetOwnerDoc());
+  NS_ENSURE_TRUE(trav, nsnull);
+
+  nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
+  nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(GetNode()));
+  nsCOMPtr<nsIDOMTreeWalker> walker;
+  trav->CreateTreeWalker(rootNode,
+                         nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
+                         nsnull, PR_FALSE, getter_AddRefs(walker));
+  NS_ENSURE_TRUE(walker, nsnull);
+
+  walker->SetCurrentNode(currentNode);
+  while (true) {
+    walker->NextNode(getter_AddRefs(currentNode));
+    if (!currentNode)
+      return nsnull;
+
+    nsCOMPtr<nsINode> node(do_QueryInterface(currentNode));
+    nsAccessible* accessible =
+      GetAccService()->GetAccessibleInWeakShell(node, mWeakShell);
+    if (accessible)
+      return accessible;
+  }
+
+  return nsnull;
 }
 
 PRBool nsAccessible::CheckVisibilityInParentChain(nsIDocument* aDocument, nsIView* aView)
 {
   nsIDocument* document = aDocument;
   nsIView* view = aView;
   // both view chain and widget chain are broken between chrome and content
   while (document != nsnull) {
@@ -3292,17 +3306,17 @@ nsAccessible::GetAttrValue(nsIAtom *aPro
   nsAutoString attrValue;
   mContent->GetAttr(kNameSpaceID_None, aProperty, attrValue);
 
   // Return zero value if there is no attribute or its value is empty.
   if (attrValue.IsEmpty())
     return NS_OK;
 
   PRInt32 error = NS_OK;
-  double value = attrValue.ToFloat(&error);
+  double value = attrValue.ToDouble(&error);
   if (NS_SUCCEEDED(error))
     *aValue = value;
 
   return NS_OK;
 }
 
 PRUint32
 nsAccessible::GetActionRule(PRUint32 aStates)
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -53,16 +53,17 @@
 #include "nsTArray.h"
 #include "nsRefPtrHashtable.h"
 
 class AccEvent;
 class AccGroupInfo;
 class EmbeddedObjCollector;
 class nsAccessible;
 class nsHyperTextAccessible;
+class nsHTMLLIAccessible;
 struct nsRoleMapEntry;
 class nsTextAccessible;
 
 struct nsRect;
 class nsIContent;
 class nsIFrame;
 class nsIAtom;
 class nsIView;
@@ -184,26 +185,33 @@ public:
 
   /**
    * Returns attributes for accessible without explicitly setted ARIA
    * attributes.
    */
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
 
   /**
+   * Used by GetChildAtPoint() method to get direct or deepest child at point.
+   */
+  enum EWhichChildAtPoint {
+    eDirectChild,
+    eDeepestChild
+  };
+
+  /**
    * Return direct or deepest child at the given point.
    *
-   * @param  aX             [in] x coordinate relative screen
-   * @param  aY             [in] y coordinate relative screen
-   * @param  aDeepestChild  [in] flag points if deep child should be returned
-   * @param  aChild         [out] found child
+   * @param  aX           [in] x coordinate relative screen
+   * @param  aY           [in] y coordinate relative screen
+   * @param  aWhichChild  [in] flag points if deepest or direct child
+   *                        should be returned
    */
-  virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                   PRBool aDeepestChild,
-                                   nsIAccessible **aChild);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
   /**
    * Return calculated group level based on accessible hierarchy.
    */
   virtual PRInt32 GetLevelInternal();
 
   /**
    * Calculate position in group and group size ('posinset' and 'setsize') based
@@ -359,16 +367,19 @@ public:
   //////////////////////////////////////////////////////////////////////////////
   // Downcasting
 
   inline bool IsApplication() const { return mFlags & eApplicationAccessible; }
 
   inline bool IsHyperText() const { return mFlags & eHyperTextAccessible; }
   nsHyperTextAccessible* AsHyperText();
 
+  inline bool IsHTMLListItem() const { return mFlags & eHTMLListItemAccessible; }
+  nsHTMLLIAccessible* AsHTMLListItem();
+
   inline bool IsRoot() const { return mFlags & eRootAccessible; }
   nsRootAccessible* AsRoot();
 
   inline bool IsTextLeaf() const { return mFlags & eTextLeafAccessible; }
   nsTextAccessible* AsTextLeaf();
 
   //////////////////////////////////////////////////////////////////////////////
   // HyperLinkAccessible
@@ -507,18 +518,19 @@ protected:
 
   /**
    * Flags describing the accessible itself.
    * @note keep these flags in sync with ChildrenFlags
    */
   enum AccessibleTypes {
     eApplicationAccessible = 1 << 2,
     eHyperTextAccessible = 1 << 3,
-    eRootAccessible = 1 << 4,
-    eTextLeafAccessible = 1 << 5
+    eHTMLListItemAccessible = 1 << 4,
+    eRootAccessible = 1 << 5,
+    eTextLeafAccessible = 1 << 6
   };
 
   //////////////////////////////////////////////////////////////////////////////
   // Miscellaneous helpers
 
   /**
    * Return ARIA role (helper method).
    */
--- a/accessible/src/base/nsApplicationAccessible.cpp
+++ b/accessible/src/base/nsApplicationAccessible.cpp
@@ -165,32 +165,21 @@ nsApplicationAccessible::GroupPosition(P
   *aGroupLevel = 0;
   NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
   *aSimilarItemsInGroup = 0;
   NS_ENSURE_ARG_POINTER(aPositionInGroup);
   *aPositionInGroup = 0;
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsAccessible*
 nsApplicationAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                         nsIAccessible **aChild)
+                                         EWhichChildAtPoint aWhichChild)
 {
-  NS_ENSURE_ARG_POINTER(aChild);
-  *aChild = nsnull;
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                                nsIAccessible **aChild)
-{
-  NS_ENSURE_ARG_POINTER(aChild);
-  *aChild = nsnull;
-  return NS_ERROR_NOT_IMPLEMENTED;
+  return nsnull;
 }
 
 NS_IMETHODIMP
 nsApplicationAccessible::GetRelationByType(PRUint32 aRelationType,
                                            nsIAccessibleRelation **aRelation)
 {
   NS_ENSURE_ARG_POINTER(aRelation);
   *aRelation = nsnull;
--- a/accessible/src/base/nsApplicationAccessible.h
+++ b/accessible/src/base/nsApplicationAccessible.h
@@ -93,18 +93,16 @@ public:
   NS_IMETHOD GetName(nsAString &aName);
   NS_IMETHOD GetValue(nsAString &aValue);
   NS_IMETHOD GetDescription(nsAString &aDescription);
   NS_IMETHOD GetKeyboardShortcut(nsAString &aKeyboardShortcut);
   NS_IMETHOD GetState(PRUint32 *aState , PRUint32 *aExtraState );
   NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
   NS_IMETHOD GroupPosition(PRInt32 *aGroupLevel, PRInt32 *aSimilarItemsInGroup,
                            PRInt32 *aPositionInGroup);
-  NS_IMETHOD GetChildAtPoint(PRInt32 aX, PRInt32 aY, nsIAccessible **aChild);
-  NS_IMETHOD GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY, nsIAccessible **aChild);
   NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
                                nsIAccessibleRelation **aRelation);
   NS_IMETHOD GetRelationsCount(PRUint32 *aRelationsCount);
   NS_IMETHOD GetRelation(PRUint32 aIndex, nsIAccessibleRelation **aRelation);
   NS_IMETHOD GetRelations(nsIArray **aRelations);
   NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
                        PRInt32 *aWidth, PRInt32 *aHeight);
   NS_IMETHOD SetSelected(PRBool aIsSelected);
@@ -123,16 +121,18 @@ public:
   virtual PRBool Init();
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
   virtual PRUint32 NativeRole();
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
   virtual void InvalidateChildren();
 
 protected:
 
   // nsAccessible
   virtual void CacheChildren();
   virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -62,24 +62,22 @@ nsLeafAccessible::
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, nsAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLeafAccessible: nsAccessible public
 
-nsresult
+nsAccessible*
 nsLeafAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                  PRBool aDeepestChild,
-                                  nsIAccessible **aChild)
+                                  EWhichChildAtPoint aWhichChild)
 {
   // Don't walk into leaf accessibles.
-  NS_ADDREF(*aChild = this);
-  return NS_OK;
+  return this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLeafAccessible: nsAccessible private
 
 void
 nsLeafAccessible::CacheChildren()
 {
--- a/accessible/src/base/nsBaseWidgetAccessible.h
+++ b/accessible/src/base/nsBaseWidgetAccessible.h
@@ -58,19 +58,18 @@ public:
   using nsAccessible::GetChildAtPoint;
 
   nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsAccessible
-  virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                   PRBool aDeepestChild,
-                                   nsIAccessible **aChild);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
 protected:
 
   // nsAccessible
   virtual void CacheChildren();
 };
 
 /**
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -645,16 +645,21 @@ nsDocAccessible::Shutdown()
 
   if (mNotificationController) {
     mNotificationController->Shutdown();
     mNotificationController = nsnull;
   }
 
   RemoveEventListeners();
 
+  // Mark the document as shutdown before AT is notified about the document
+  // removal from its container (valid for root documents on ATK).
+  nsCOMPtr<nsIDocument> kungFuDeathGripDoc = mDocument;
+  mDocument = nsnull;
+
   if (mParent) {
     nsDocAccessible* parentDocument = mParent->GetDocAccessible();
     if (parentDocument)
       parentDocument->RemoveChildDocument(this);
 
     mParent->RemoveChild(this);
   }
 
@@ -667,19 +672,16 @@ nsDocAccessible::Shutdown()
   mChildDocuments.Clear();
 
   mWeakShell = nsnull;  // Avoid reentrancy
 
   mDependentIDsHash.Clear();
   mNodeToAccessibleMap.Clear();
   ClearCache(mAccessibleCache);
 
-  nsCOMPtr<nsIDocument> kungFuDeathGripDoc = mDocument;
-  mDocument = nsnull;
-
   nsHyperTextAccessibleWrap::Shutdown();
 
   GetAccService()->NotifyOfDocumentShutdown(kungFuDeathGripDoc);
 }
 
 nsIFrame*
 nsDocAccessible::GetFrame() const
 {
@@ -1224,29 +1226,27 @@ nsDocAccessible::ARIAAttributeChanged(ns
 
 void nsDocAccessible::ContentAppended(nsIDocument *aDocument,
                                       nsIContent* aContainer,
                                       nsIContent* aFirstNewContent,
                                       PRInt32 /* unused */)
 {
 }
 
-void nsDocAccessible::ContentStatesChanged(nsIDocument* aDocument,
-                                           nsIContent* aContent1,
-                                           nsIContent* aContent2,
-                                           nsEventStates aStateMask)
+void nsDocAccessible::ContentStateChanged(nsIDocument* aDocument,
+                                          nsIContent* aContent,
+                                          nsEventStates aStateMask)
 {
   if (aStateMask.HasState(NS_EVENT_STATE_CHECKED)) {
-    nsHTMLSelectOptionAccessible::SelectionChangedIfOption(aContent1);
-    nsHTMLSelectOptionAccessible::SelectionChangedIfOption(aContent2);
+    nsHTMLSelectOptionAccessible::SelectionChangedIfOption(aContent);
   }
 
   if (aStateMask.HasState(NS_EVENT_STATE_INVALID)) {
     nsRefPtr<AccEvent> event =
-      new AccStateChangeEvent(aContent1, nsIAccessibleStates::STATE_INVALID,
+      new AccStateChangeEvent(aContent, nsIAccessibleStates::STATE_INVALID,
                               PR_FALSE, PR_TRUE);
     FireDelayedAccessibleEvent(event);
    }
 }
 
 void nsDocAccessible::DocumentStatesChanged(nsIDocument* aDocument,
                                             nsEventStates aStateMask)
 {
@@ -1467,17 +1467,20 @@ nsDocAccessible::NotifyOfCachingEnd(nsAc
     // Invalidate children of container accessible for each element in
     // invalidation list.
     for (PRUint32 idx = 0; idx < mInvalidationList.Length(); idx++) {
       nsIContent* content = mInvalidationList[idx];
       if (!HasAccessible(content)) {
         // Make sure we keep children updated. While we're inside of caching
         // loop then we must exist it with cached children.
         nsAccessible* container = GetContainerAccessible(content);
-        container->UpdateChildren();
+        NS_ASSERTION(container,
+                     "Got a referenced element that is not in document!");
+        if (container)
+          container->UpdateChildren();
       }
     }
     mInvalidationList.Clear();
 
     mCacheRoot = nsnull;
     mIsPostCacheProcessing = PR_FALSE;
   }
 }
@@ -1945,18 +1948,19 @@ nsDocAccessible::UpdateTreeInternal(nsIC
 void
 nsDocAccessible::CacheChildrenInSubtree(nsAccessible* aRoot)
 {
   aRoot->EnsureChildren();
 
   PRUint32 count = aRoot->GetChildCount();
   for (PRUint32 idx = 0; idx < count; idx++)  {
     nsAccessible* child = aRoot->GetChildAt(idx);
+    NS_ASSERTION(child, "Illicit tree change while tree is created!");
     // Don't cross document boundaries.
-    if (child->IsContent())
+    if (child && child->IsContent())
       CacheChildrenInSubtree(child);
   }
 }
 
 void
 nsDocAccessible::UncacheChildrenInSubtree(nsAccessible* aRoot)
 {
   if (aRoot->IsElement())
--- a/accessible/src/base/nsOuterDocAccessible.cpp
+++ b/accessible/src/base/nsOuterDocAccessible.cpp
@@ -71,42 +71,35 @@ nsOuterDocAccessible::GetStateInternal(P
 {
   nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
   NS_ENSURE_A11Y_SUCCESS(rv, rv);
 
   *aState &= ~nsIAccessibleStates::STATE_FOCUSABLE;
   return NS_OK;
 }
 
-nsresult
+nsAccessible*
 nsOuterDocAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                      PRBool aDeepestChild,
-                                      nsIAccessible **aChild)
+                                      EWhichChildAtPoint aWhichChild)
 {
   PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
   nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
-  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_SUCCESS(rv, nsnull);
 
   if (aX < docX || aX >= docX + docWidth || aY < docY || aY >= docY + docHeight)
-    return NS_OK;
+    return nsnull;
 
   // Always return the inner doc as direct child accessible unless bounds
   // outside of it.
-  nsCOMPtr<nsIAccessible> childAcc;
-  rv = GetFirstChild(getter_AddRefs(childAcc));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsAccessible* child = GetChildAt(0);
+  NS_ENSURE_TRUE(child, nsnull);
 
-  if (!childAcc)
-    return NS_OK;
-
-  if (aDeepestChild)
-    return childAcc->GetDeepestChildAtPoint(aX, aY, aChild);
-
-  NS_ADDREF(*aChild = childAcc);
-  return NS_OK;
+  if (aWhichChild = eDeepestChild)
+    return child->GetChildAtPoint(aX, aY, eDeepestChild);
+  return child;
 }
 
 nsresult
 nsOuterDocAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
 {
   nsAutoString tag;
   aAttributes->GetStringProperty(NS_LITERAL_CSTRING("tag"), tag);
   if (!tag.IsEmpty()) {
--- a/accessible/src/base/nsOuterDocAccessible.h
+++ b/accessible/src/base/nsOuterDocAccessible.h
@@ -65,19 +65,18 @@ public:
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
-  virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                   PRBool aDeepestChild,
-                                   nsIAccessible **aChild);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
   virtual void InvalidateChildren();
   virtual PRBool AppendChild(nsAccessible *aAccessible);
   virtual PRBool RemoveChild(nsAccessible *aAccessible);
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
--- a/accessible/src/html/nsHTMLImageMapAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageMapAccessible.cpp
@@ -241,24 +241,22 @@ nsHTMLAreaAccessible::GetStateInternal(P
       mRoleMapEntry->role != nsIAccessibleRole::ROLE_NOTHING &&
       mRoleMapEntry->role != nsIAccessibleRole::ROLE_LINK) {
     return nsAccessible::GetStateInternal(aState,aExtraState);
   }
 
   return nsHTMLLinkAccessible::GetStateInternal(aState, aExtraState);
 }
 
-nsresult
+nsAccessible*
 nsHTMLAreaAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                      PRBool aDeepestChild,
-                                      nsIAccessible **aChild)
+                                      EWhichChildAtPoint aWhichChild)
 {
   // Don't walk into area accessibles.
-  NS_ADDREF(*aChild = this);
-  return NS_OK;
+  return this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLImageMapAccessible: HyperLinkAccessible
 
 PRUint32
 nsHTMLAreaAccessible::StartOffset()
 {
--- a/accessible/src/html/nsHTMLImageMapAccessible.h
+++ b/accessible/src/html/nsHTMLImageMapAccessible.h
@@ -89,19 +89,18 @@ public:
   // nsIAccessible
   NS_IMETHOD GetDescription(nsAString& aDescription);
 
   NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
 
   // nsAccessible
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
-  virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                   PRBool aDeepestChild,
-                                   nsIAccessible **aChild);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
   // HyperLinkAccessible
   virtual PRUint32 StartOffset();
   virtual PRUint32 EndOffset();
 
 protected:
 
   // nsAccessible
--- a/accessible/src/html/nsHTMLTextAccessible.cpp
+++ b/accessible/src/html/nsHTMLTextAccessible.cpp
@@ -249,37 +249,36 @@ nsHTMLOutputAccessible::GetAttributesInt
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLLIAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsHTMLLIAccessible::
   nsHTMLLIAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
-  nsHyperTextAccessibleWrap(aContent, aShell)
+  nsHyperTextAccessibleWrap(aContent, aShell), mBullet(nsnull)
 {
+  mFlags |= eHTMLListItemAccessible;
+
   nsBlockFrame* blockFrame = do_QueryFrame(GetFrame());
-  if (blockFrame && !blockFrame->BulletIsEmptyExternal()) {
-    mBulletAccessible = new nsHTMLListBulletAccessible(mContent, mWeakShell);
-    GetDocAccessible()->BindToDocument(mBulletAccessible, nsnull);
+  if (blockFrame && blockFrame->HasBullet()) {
+    mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell);
+    if (!GetDocAccessible()->BindToDocument(mBullet, nsnull))
+      mBullet = nsnull;
   }
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLLIAccessible, nsHyperTextAccessible)
 
 void
 nsHTMLLIAccessible::Shutdown()
 {
-  if (mBulletAccessible) {
-    // Ensure that pointer to this is nulled out.
-    mBulletAccessible->Shutdown();
-  }
+  mBullet = nsnull;
 
   nsHyperTextAccessibleWrap::Shutdown();
-  mBulletAccessible = nsnull;
 }
 
 PRUint32
 nsHTMLLIAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_LISTITEM;
 }
 
@@ -292,63 +291,81 @@ nsHTMLLIAccessible::GetStateInternal(PRU
 
   *aState |= nsIAccessibleStates::STATE_READONLY;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsHTMLLIAccessible::GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
 {
   nsresult rv = nsAccessibleWrap::GetBounds(x, y, width, height);
-  if (NS_FAILED(rv) || !mBulletAccessible) {
+  if (NS_FAILED(rv) || !mBullet)
     return rv;
-  }
 
   PRInt32 bulletX, bulletY, bulletWidth, bulletHeight;
-  rv = mBulletAccessible->GetBounds(&bulletX, &bulletY, &bulletWidth, &bulletHeight);
+  rv = mBullet->GetBounds(&bulletX, &bulletY, &bulletWidth, &bulletHeight);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *x = bulletX; // Move x coordinate of list item over to cover bullet as well
   *width += bulletWidth;
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+// nsHTMLLIAccessible: public
+
+void
+nsHTMLLIAccessible::UpdateBullet(bool aHasBullet)
+{
+  if (aHasBullet == !!mBullet) {
+    NS_NOTREACHED("Bullet and accessible are in sync already!");
+    return;
+  }
+
+  nsDocAccessible* document = GetDocAccessible();
+  if (aHasBullet) {
+    mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell);
+    if (document->BindToDocument(mBullet, nsnull)) {
+      InsertChildAt(0, mBullet);
+    }
+  } else {
+    RemoveChild(mBullet);
+    document->UnbindFromDocument(mBullet);
+    mBullet = nsnull;
+  }
+
+  // XXXtodo: fire show/hide and reorder events. That's hard to make it
+  // right now because coalescence happens by DOM node.
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // nsHTMLLIAccessible: nsAccessible protected
 
 void
 nsHTMLLIAccessible::CacheChildren()
 {
-  if (mBulletAccessible)
-    AppendChild(mBulletAccessible);
+  if (mBullet)
+    AppendChild(mBullet);
 
   // Cache children from subtree.
   nsAccessibleWrap::CacheChildren();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLListBulletAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsHTMLListBulletAccessible::
   nsHTMLListBulletAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
     nsLeafAccessible(aContent, aShell)
 {
-  mBulletText += ' '; // Otherwise bullets are jammed up against list text
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLListBulletAccessible: nsAccessNode
 
-void
-nsHTMLListBulletAccessible::Shutdown()
-{
-  mBulletText.Truncate();
-  nsLeafAccessible::Shutdown();
-}
-
 bool
 nsHTMLListBulletAccessible::IsPrimaryForNode() const
 {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLListBulletAccessible: nsAccessible
@@ -358,16 +375,17 @@ nsHTMLListBulletAccessible::GetName(nsAS
 {
   aName.Truncate();
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // Native anonymous content, ARIA can't be used. Get list bullet text.
   nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  NS_ASSERTION(blockFrame, "No frame for list item!");
   if (blockFrame) {
     blockFrame->GetBulletText(aName);
 
     // Append space otherwise bullets are jammed up against list text.
     aName.Append(' ');
   }
 
   return NS_OK;
@@ -389,27 +407,23 @@ nsHTMLListBulletAccessible::GetStateInte
   *aState |= nsIAccessibleStates::STATE_READONLY;
   return NS_OK;
 }
 
 void
 nsHTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
                                          PRUint32 aLength)
 {
+  nsAutoString bulletText;
   nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());
-  if (blockFrame) {
-    nsAutoString bulletText;
+  NS_ASSERTION(blockFrame, "No frame for list item!");
+  if (blockFrame)
     blockFrame->GetBulletText(bulletText);
 
-    PRUint32 maxLength = bulletText.Length() - aStartOffset;
-    if (aLength > maxLength)
-      aLength = maxLength;
-
-    aText += Substring(bulletText, aStartOffset, aLength);
-  }
+  aText.Append(Substring(bulletText, aStartOffset, aLength));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLListAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsHTMLListAccessible::
   nsHTMLListAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
--- a/accessible/src/html/nsHTMLTextAccessible.h
+++ b/accessible/src/html/nsHTMLTextAccessible.h
@@ -131,33 +131,23 @@ class nsHTMLListBulletAccessible : publi
 {
 public:
   nsHTMLListBulletAccessible(nsIContent* aContent, nsIWeakReference* aShell);
 
   // nsIAccessible
   NS_IMETHOD GetName(nsAString& aName);
 
   // nsAccessNode
-  virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual void AppendTextTo(nsAString& aText, PRUint32 aStartOffset = 0,
                             PRUint32 aLength = PR_UINT32_MAX);
-
-protected:
-  // XXX: Ideally we'd get the bullet text directly from the bullet frame via
-  // nsBulletFrame::GetListItemText(), but we'd need an interface for getting
-  // text from contentless anonymous frames. Perhaps something like
-  // nsIAnonymousFrame::GetText() ? However, in practice storing the bullet text
-  // here should not be a problem if we invalidate the right parts of
-  // the accessibility cache when mutation events occur.
-  nsString mBulletText;
 };
 
 /**
  * Used for HTML list (like HTML ul).
  */
 class nsHTMLListAccessible : public nsHyperTextAccessibleWrap
 {
 public:
@@ -177,27 +167,37 @@ public:
 class nsHTMLLIAccessible : public nsHyperTextAccessibleWrap
 {
 public:
   nsHTMLLIAccessible(nsIContent* aContent, nsIWeakReference* aShell);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
+  // nsAccessNode
+  virtual void Shutdown();
+
   // nsIAccessible
   NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
 
-  // nsAccessNode
-  virtual void Shutdown();
-
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
+  // nsHTMLLIAccessible
+  void UpdateBullet(bool aHasBullet);
+
 protected:
   // nsAccessible
   virtual void CacheChildren();
 
 private:
-  nsRefPtr<nsHTMLListBulletAccessible> mBulletAccessible;
+  nsRefPtr<nsHTMLListBulletAccessible> mBullet;
 };
 
-#endif  
+inline nsHTMLLIAccessible*
+nsAccessible::AsHTMLListItem()
+{
+  return mFlags & eHTMLListItemAccessible ?
+    static_cast<nsHTMLLIAccessible*>(this) : nsnull;
+}
+
+#endif
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -190,21 +190,18 @@ nsHyperTextAccessible::GetStateInternal(
     if (0 == (flags & nsIPlaintextEditor::eEditorReadonlyMask)) {
       *aExtraState |= nsIAccessibleStates::EXT_STATE_EDITABLE;
     }
   } else if (mContent->Tag() == nsAccessibilityAtoms::article) {
     // We want <article> to behave like a document in terms of readonly state.
     *aState |= nsIAccessibleStates::STATE_READONLY;
   }
 
-  PRInt32 childCount;
-  GetChildCount(&childCount);
-  if (childCount > 0) {
+  if (GetChildCount() > 0)
     *aExtraState |= nsIAccessibleStates::EXT_STATE_SELECTABLE_TEXT;
-  }
 
   return NS_OK;
 }
 
 // Substring must be entirely within the same text node
 nsIntRect nsHyperTextAccessible::GetBoundsForString(nsIFrame *aFrame, PRUint32 aStartRenderedOffset,
                                                     PRUint32 aEndRenderedOffset)
 {
--- a/accessible/src/mac/Makefile.in
+++ b/accessible/src/mac/Makefile.in
@@ -38,16 +38,17 @@ DEPTH = ../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = accessibility
 LIBRARY_NAME = accessibility_toolkit_s
+EXPORT_LIBRARY = ..
 LIBXUL_LIBRARY = 1
 
   
   
 CMMSRCS = nsAccessNodeWrap.mm \
           nsDocAccessibleWrap.mm \
           nsRootAccessibleWrap.mm \
           nsAccessibleWrap.mm \
--- a/accessible/src/msaa/Makefile.in
+++ b/accessible/src/msaa/Makefile.in
@@ -38,16 +38,17 @@ DEPTH = ../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = accessibility
 LIBRARY_NAME = accessibility_toolkit_s
+EXPORT_LIBRARY = ..
 LIBXUL_LIBRARY = 1
 
 
 CPPSRCS = \
   nsAccessNodeWrap.cpp \
   nsAccessibleWrap.cpp \
   nsTextAccessibleWrap.cpp \
   nsDocAccessibleWrap.cpp \
--- a/accessible/src/msaa/nsAccessNodeWrap.cpp
+++ b/accessible/src/msaa/nsAccessNodeWrap.cpp
@@ -303,17 +303,17 @@ STDMETHODIMP nsAccessNodeWrap::get_attri
 
 STDMETHODIMP nsAccessNodeWrap::get_attributesForNames( 
     /* [in] */ unsigned short aNumAttribs,
     /* [length_is][size_is][in] */ BSTR __RPC_FAR *aAttribNames,
     /* [length_is][size_is][in] */ short __RPC_FAR *aNameSpaceID,
     /* [length_is][size_is][retval] */ BSTR __RPC_FAR *aAttribValues)
 {
 __try {
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || !IsElement())
     return E_FAIL;
 
   nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(mContent));
   nsCOMPtr<nsINameSpaceManager> nameSpaceManager =
     do_GetService(NS_NAMESPACEMANAGER_CONTRACTID);
 
   PRInt32 index;
 
@@ -611,35 +611,27 @@ void nsAccessNodeWrap::InitAccessibility
     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);
-  }
+  nsWinUtils::MaybeStartWindowEmulation();
 
   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));
+  nsWinUtils::ShutdownWindowEmulation();
 
   nsAccessNode::ShutdownXPAccessibility();
 }
 
 int nsAccessNodeWrap::FilterA11yExceptions(unsigned int aCode, EXCEPTION_POINTERS *aExceptionInfo)
 {
   if (aCode == EXCEPTION_ACCESS_VIOLATION) {
 #ifdef MOZ_CRASHREPORTER
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -198,17 +198,17 @@ STDMETHODIMP nsAccessibleWrap::get_accPa
   if (IsDefunct())
     return E_FAIL;
 
   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::IsWindowEmulationStarted() &&
         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;
       }
     }
@@ -231,19 +231,17 @@ STDMETHODIMP nsAccessibleWrap::get_accPa
 
 STDMETHODIMP nsAccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren)
 {
 __try {
   *pcountChildren = 0;
   if (nsAccUtils::MustPrune(this))
     return NS_OK;
 
-  PRInt32 numChildren;
-  GetChildCount(&numChildren);
-  *pcountChildren = numChildren;
+  *pcountChildren = GetChildCount();
 } __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
 
   return S_OK;
 }
 
 STDMETHODIMP nsAccessibleWrap::get_accChild(
       /* [in] */ VARIANT varChild,
       /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispChild)
@@ -1009,19 +1007,17 @@ STDMETHODIMP
 nsAccessibleWrap::Skip(ULONG aNumElements)
 {
 __try {
   if (mEnumVARIANTPosition == kIEnumVariantDisconnected)
     return CO_E_OBJNOTCONNECTED;
 
   mEnumVARIANTPosition += aNumElements;
 
-  PRInt32 numChildren;
-  GetChildCount(&numChildren);
-
+  PRInt32 numChildren = GetChildCount();
   if (mEnumVARIANTPosition > numChildren)
   {
     mEnumVARIANTPosition = numChildren;
     return S_FALSE;
   }
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return NOERROR;
 }
--- a/accessible/src/msaa/nsDocAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsDocAccessibleWrap.cpp
@@ -250,20 +250,21 @@ STDMETHODIMP nsDocAccessibleWrap::get_ac
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode
 
 void
 nsDocAccessibleWrap::Shutdown()
 {
-  if (nsWinUtils::IsWindowEmulationEnabled()) {
+  // Do window emulation specific shutdown if emulation was started.
+  if (nsWinUtils::IsWindowEmulationStarted()) {
     // Destroy window created for root document.
     if (nsWinUtils::IsTabDocument(mDocument)) {
-      nsAccessibleWrap::sHWNDCache.Remove(mHWND);
+      sHWNDCache.Remove(mHWND);
       ::DestroyWindow(static_cast<HWND>(mHWND));
     }
 
     mHWND = nsnull;
   }
 
   nsDocAccessible::Shutdown();
 }
@@ -280,40 +281,40 @@ nsDocAccessibleWrap::GetNativeWindow() c
 ////////////////////////////////////////////////////////////////////////////////
 // nsDocAccessible protected
 
 void
 nsDocAccessibleWrap::NotifyOfInitialUpdate()
 {
   nsDocAccessible::NotifyOfInitialUpdate();
 
-  if (nsWinUtils::IsWindowEmulationEnabled()) {
+  if (nsWinUtils::IsWindowEmulationStarted()) {
     // Create window for tab document.
     if (nsWinUtils::IsTabDocument(mDocument)) {
       nsRootAccessible* rootDocument = RootAccessible();
 
       PRBool isActive = PR_TRUE;
       PRInt32 x = CW_USEDEFAULT, y = CW_USEDEFAULT, width = 0, height = 0;
-      if (nsWinUtils::IsWindowEmulationEnabled(kDolphinModuleHandle)) {
+      if (nsWinUtils::IsWindowEmulationFor(kDolphinModuleHandle)) {
         GetBounds(&x, &y, &width, &height);
         PRInt32 rootX = 0, rootY = 0, rootWidth = 0, rootHeight = 0;
         rootDocument->GetBounds(&rootX, &rootY, &rootWidth, &rootHeight);
         x = rootX - x;
         y -= rootY;
 
         nsCOMPtr<nsISupports> container = mDocument->GetContainer();
         nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
         docShell->GetIsActive(&isActive);
       }
 
       HWND parentWnd = static_cast<HWND>(rootDocument->GetNativeWindow());
       mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd,
                                              x, y, width, height, isActive);
 
-      nsAccessibleWrap::sHWNDCache.Put(mHWND, this);
+      sHWNDCache.Put(mHWND, this);
 
     } else {
       nsDocAccessible* parentDocument = ParentDocument();
       if (parentDocument)
         mHWND = parentDocument->GetNativeWindow();
     }
   }
 }
--- a/accessible/src/msaa/nsRootAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsRootAccessibleWrap.cpp
@@ -58,17 +58,17 @@ nsRootAccessibleWrap::~nsRootAccessibleW
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsRootAccessible
 
 void
 nsRootAccessibleWrap::DocumentActivated(nsDocAccessible* aDocument)
 {
-  if (nsWinUtils::IsWindowEmulationEnabled(kDolphinModuleHandle) &&
+  if (nsWinUtils::IsWindowEmulationFor(kDolphinModuleHandle) &&
       nsWinUtils::IsTabDocument(aDocument->GetDocumentNode())) {
     PRUint32 count = mChildDocuments.Length();
     for (PRUint32 idx = 0; idx < count; idx++) {
       nsDocAccessible* childDoc = mChildDocuments[idx];
       HWND childDocHWND = static_cast<HWND>(childDoc->GetNativeWindow());
       if (childDoc != aDocument)
         nsWinUtils::HideNativeWindow(childDocHWND);
       else
--- a/accessible/src/msaa/nsWinUtils.cpp
+++ b/accessible/src/msaa/nsWinUtils.cpp
@@ -94,16 +94,44 @@ nsWinUtils::ConvertToIA2Array(nsIArray *
     ::CoTaskMemFree(*aIA2Array);
     return GetHRESULT(rv);
   }
 
   *aIA2ArrayLen = length;
   return S_OK;
 }
 
+bool
+nsWinUtils::MaybeStartWindowEmulation()
+{
+  // Register window class that'll be used for document accessibles associated
+  // with tabs.
+  if (IsWindowEmulationFor(0)) {
+    RegisterNativeWindow(kClassNameTabContent);
+    nsAccessNodeWrap::sHWNDCache.Init(4);
+    return true;
+  }
+  return false;
+}
+
+void
+nsWinUtils::ShutdownWindowEmulation()
+{
+  // Unregister window call that's used for document accessibles associated
+  // with tabs.
+  if (IsWindowEmulationFor(0))
+    ::UnregisterClassW(kClassNameTabContent, GetModuleHandle(NULL));
+}
+
+bool
+nsWinUtils::IsWindowEmulationStarted()
+{
+  return nsAccessNodeWrap::sHWNDCache.IsInitialized();
+}
+
 void
 nsWinUtils::RegisterNativeWindow(LPCWSTR aWindowClass)
 {
   WNDCLASSW wc;
   wc.style = CS_GLOBALCLASS;
   wc.lpfnWndProc = nsAccessNodeWrap::WindowProc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = 0;
@@ -141,17 +169,17 @@ void
 nsWinUtils::HideNativeWindow(HWND aWnd)
 {
   ::SetWindowPos(aWnd, NULL, 0, 0, 0, 0,
                  SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE |
                  SWP_NOZORDER | SWP_NOACTIVATE);
 }
 
 bool
-nsWinUtils::IsWindowEmulationEnabled(LPCWSTR kModuleHandle)
+nsWinUtils::IsWindowEmulationFor(LPCWSTR kModuleHandle)
 {
   return kModuleHandle ? ::GetModuleHandleW(kModuleHandle) :
     ::GetModuleHandleW(kJAWSModuleHandle) ||
     ::GetModuleHandleW(kWEModuleHandle)  ||
     ::GetModuleHandleW(kDolphinModuleHandle);
 }
 
 bool
--- a/accessible/src/msaa/nsWinUtils.h
+++ b/accessible/src/msaa/nsWinUtils.h
@@ -59,16 +59,31 @@ 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);
 
   /**
+   * Start window emulation if presence of specific AT is detected.
+   */
+  static bool MaybeStartWindowEmulation();
+
+  /**
+   * Free resources used for window emulation.
+   */
+  static void ShutdownWindowEmulation();
+
+  /**
+   * Return true if window emulation is started.
+   */
+  static bool IsWindowEmulationStarted();
+
+  /**
    * Helper to register window class.
    */
   static void RegisterNativeWindow(LPCWSTR aWindowClass);
 
   /**
    * Helper to create a window.
    */
   static HWND CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd,
@@ -83,17 +98,17 @@ public:
   /**
    * Helper to hide window.
    */
   static void HideNativeWindow(HWND aWnd);
 
   /**
    * Return true if window emulation is enabled.
    */
-  static bool IsWindowEmulationEnabled(LPCWSTR kModuleHandle = 0);
+  static bool IsWindowEmulationFor(LPCWSTR kModuleHandle);
 
   /**
    * Return true if the given document node is for tab document accessible.
    */
   static bool IsTabDocument(nsIDocument* aDocumentNode);
 };
 
 #endif
--- a/accessible/src/other/Makefile.in
+++ b/accessible/src/other/Makefile.in
@@ -38,16 +38,17 @@ DEPTH = ../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = accessibility
 LIBRARY_NAME = accessibility_toolkit_s
+EXPORT_LIBRARY = ..
 LIBXUL_LIBRARY = 1
 
 
 CPPSRCS = \
   nsAccessNodeWrap.cpp \
   nsAccessibleWrap.cpp \
   nsRootAccessibleWrap.cpp \
   $(NULL)
--- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
@@ -357,62 +357,62 @@ nsXFormsRangeAccessible::GetMaximumValue
   NS_ENSURE_ARG_POINTER(aMaximumValue);
 
   nsAutoString value;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   nsresult rv = sXFormsService->GetRangeEnd(DOMNode, value);
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 error = NS_OK;
-  *aMaximumValue = value.ToFloat(&error);
+  *aMaximumValue = value.ToDouble(&error);
   return error;
 }
 
 NS_IMETHODIMP
 nsXFormsRangeAccessible::GetMinimumValue(double *aMinimumValue)
 {
   NS_ENSURE_ARG_POINTER(aMinimumValue);
 
   nsAutoString value;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   nsresult rv = sXFormsService->GetRangeStart(DOMNode, value);
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 error = NS_OK;
-  *aMinimumValue = value.ToFloat(&error);
+  *aMinimumValue = value.ToDouble(&error);
   return error;
 }
 
 NS_IMETHODIMP
 nsXFormsRangeAccessible::GetMinimumIncrement(double *aMinimumIncrement)
 {
   NS_ENSURE_ARG_POINTER(aMinimumIncrement);
 
   nsAutoString value;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   nsresult rv = sXFormsService->GetRangeStep(DOMNode, value);
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 error = NS_OK;
-  *aMinimumIncrement = value.ToFloat(&error);
+  *aMinimumIncrement = value.ToDouble(&error);
   return error;
 }
 
 NS_IMETHODIMP
 nsXFormsRangeAccessible::GetCurrentValue(double *aCurrentValue)
 {
   NS_ENSURE_ARG_POINTER(aCurrentValue);
 
   nsAutoString value;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   nsresult rv = sXFormsService->GetValue(DOMNode, value);
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 error = NS_OK;
-  *aCurrentValue = value.ToFloat(&error);
+  *aCurrentValue = value.ToDouble(&error);
   return error;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXFormsSelectAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
--- a/accessible/src/xul/nsXULFormControlAccessible.cpp
+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
@@ -564,17 +564,17 @@ nsXULProgressMeterAccessible::GetMaximum
 {
   nsresult rv = nsFormControlAccessible::GetMaximumValue(aMaximumValue);
   if (rv != NS_OK_NO_ARIA_VALUE)
     return rv;
 
   nsAutoString value;
   if (mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::max, value)) {
     PRInt32 result = NS_OK;
-    *aMaximumValue = value.ToFloat(&result);
+    *aMaximumValue = value.ToDouble(&result);
     return result;
   }
 
   *aMaximumValue = 1; // 100% = 1;
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -609,17 +609,17 @@ nsXULProgressMeterAccessible::GetCurrent
   nsAutoString attrValue;
   mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::value, attrValue);
 
   // Return zero value if there is no attribute or its value is empty.
   if (attrValue.IsEmpty())
     return NS_OK;
 
   PRInt32 error = NS_OK;
-  double value = attrValue.ToFloat(&error);
+  double value = attrValue.ToDouble(&error);
   if (NS_FAILED(error))
     return NS_OK; // Zero value because of wrong markup.
 
   // If no max value then value is between 0 and 1 (refer to GetMaximumValue()
   // method where max value is assumed to be equal to 1 in this case).
   if (!mContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::max))
     value /= 100;
 
--- a/accessible/src/xul/nsXULSliderAccessible.cpp
+++ b/accessible/src/xul/nsXULSliderAccessible.cpp
@@ -267,17 +267,17 @@ nsXULSliderAccessible::GetSliderAttr(nsI
   nsresult rv = GetSliderAttr(aName, attrValue);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Return zero value if there is no attribute or its value is empty.
   if (attrValue.IsEmpty())
     return NS_OK;
 
   PRInt32 error = NS_OK;
-  double value = attrValue.ToFloat(&error);
+  double value = attrValue.ToDouble(&error);
   if (NS_SUCCEEDED(error))
     *aValue = value;
 
   return NS_OK;
 }
 
 nsresult
 nsXULSliderAccessible::SetSliderAttr(nsIAtom *aName, double aValue)
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -223,59 +223,57 @@ nsXULTreeAccessible::GetFocusedChild(nsI
   }
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessible implementation (DON'T put methods here)
 
-nsresult
+nsAccessible*
 nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                     PRBool aDeepestChild,
-                                     nsIAccessible **aChild)
+                                     EWhichChildAtPoint aWhichChild)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
-    return NS_ERROR_FAILURE;
+    return nsnull;
 
   nsPresContext *presContext = frame->PresContext();
   nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
 
   nsIFrame *rootFrame = presShell->GetRootFrame();
-  NS_ENSURE_STATE(rootFrame);
+  NS_ENSURE_TRUE(rootFrame, nsnull);
 
   nsIntRect rootRect = rootFrame->GetScreenRectExternal();
 
   PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX - rootRect.x);
   PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY - rootRect.y);
 
   PRInt32 row = -1;
   nsCOMPtr<nsITreeColumn> column;
   nsCAutoString childEltUnused;
   mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                    childEltUnused);
 
   // If we failed to find tree cell for the given point then it might be
   // tree columns.
   if (row == -1 || !column)
-    return nsAccessibleWrap::GetChildAtPoint(aX, aY, aDeepestChild, aChild);
+    return nsAccessibleWrap::GetChildAtPoint(aX, aY, aWhichChild);
 
   nsAccessible *child = GetTreeItemAccessible(row);
-  if (aDeepestChild && child) {
+  if (aWhichChild == eDeepestChild && child) {
     // Look for accessible cell for the found item accessible.
     nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
 
     nsAccessible *cell = treeitem->GetCellAccessible(column);
     if (cell)
       child = cell;
   }
 
-  NS_IF_ADDREF(*aChild = child);
-  return NS_OK;
+  return child;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: SelectAccessible
 
 bool
 nsXULTreeAccessible::IsSelect()
 {
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/nsXULTreeAccessible.h
@@ -81,19 +81,18 @@ public:
 
   // nsAccessNode
   virtual PRBool IsDefunct();
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
-  virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                   PRBool aDeepestChild,
-                                   nsIAccessible **aChild);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
   virtual PRInt32 GetChildCount();
 
   // SelectAccessible
   virtual bool IsSelect();
   virtual already_AddRefed<nsIArray> SelectedItems();
   virtual PRUint32 SelectedItemCount();
--- a/accessible/src/xul/nsXULTreeGridAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeGridAccessible.cpp
@@ -659,48 +659,46 @@ nsXULTreeGridRowAccessible::Shutdown()
 // nsXULTreeGridRowAccessible: nsAccessible implementation
 
 PRUint32
 nsXULTreeGridRowAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_ROW;
 }
 
-nsresult
+nsAccessible*
 nsXULTreeGridRowAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                            PRBool aDeepestChild,
-                                            nsIAccessible **aChild)
+                                            EWhichChildAtPoint aWhichChild)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
-    return NS_ERROR_FAILURE;
+    return nsnull;
 
   nsPresContext *presContext = frame->PresContext();
   nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
 
   nsIFrame *rootFrame = presShell->GetRootFrame();
-  NS_ENSURE_STATE(rootFrame);
+  NS_ENSURE_TRUE(rootFrame, nsnull);
 
   nsIntRect rootRect = rootFrame->GetScreenRectExternal();
 
   PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX - rootRect.x);
   PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY - rootRect.y);
 
   PRInt32 row = -1;
   nsCOMPtr<nsITreeColumn> column;
   nsCAutoString childEltUnused;
   mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                    childEltUnused);
 
   // Return if we failed to find tree cell in the row for the given point.
   if (row != mRow || !column)
-    return NS_OK;
+    return nsnull;
 
-  NS_IF_ADDREF(*aChild = GetCellAccessible(column));
-  return NS_OK;
+  return GetCellAccessible(column);
 }
 
 nsAccessible*
 nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
 {
   if (IsDefunct())
     return nsnull;
 
--- a/accessible/src/xul/nsXULTreeGridAccessible.h
+++ b/accessible/src/xul/nsXULTreeGridAccessible.h
@@ -88,19 +88,18 @@ public:
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridRowAccessible,
                                            nsAccessible)
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
-  virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                   PRBool aDeepestChild,
-                                   nsIAccessible **aChild);
+  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                        EWhichChildAtPoint aWhichChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
   virtual PRInt32 GetChildCount();
 
   // nsXULTreeItemAccessibleBase
   virtual nsAccessible* GetCellAccessible(nsITreeColumn *aColumn);
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
 
--- a/accessible/tests/mochitest/attributes/test_text.html
+++ b/accessible/tests/mochitest/attributes/test_text.html
@@ -1,12 +1,13 @@
 <html>
 
 <head>
   <title>Text attributes tests</title>
+  <meta charset="utf-8" />
   <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"
@@ -185,53 +186,53 @@
       //////////////////////////////////////////////////////////////////////////
       // area7
       ID = "area7";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       defAttrs["language"] = "en";
       testDefaultTextAttrs(ID, defAttrs);
 
       attrs = {"language": "ru"};
-      testTextAttrs(ID, 0, attrs, defAttrs, 0, 12);
+      testTextAttrs(ID, 0, attrs, defAttrs, 0, 6);
 
       attrs = {};
-      testTextAttrs(ID, 12, attrs, defAttrs, 12, 13);
+      testTextAttrs(ID, 6, attrs, defAttrs, 6, 7);
 
       tempElem = getNode(ID).firstChild.nextSibling.nextSibling.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = { "background-color": gComputedStyle.backgroundColor};
-      testTextAttrs(ID, 13, attrs, defAttrs, 13, 26);
+      testTextAttrs(ID, 13, attrs, defAttrs, 7, 20);
 
       attrs = {};
-      testTextAttrs(ID, 26, attrs, defAttrs, 26, 27);
+      testTextAttrs(ID, 20, attrs, defAttrs, 20, 21);
 
       attrs = {"language": "de"};
-      testTextAttrs(ID, 27, attrs, defAttrs, 27, 42);
+      testTextAttrs(ID, 21, attrs, defAttrs, 21, 36);
 
       attrs = {};
-      testTextAttrs(ID, 42, attrs, defAttrs, 42, 50);
+      testTextAttrs(ID, 36, attrs, defAttrs, 36, 44);
 
       attrs = {};
-      testTextAttrs(ID, 43, attrs, defAttrs, 42, 50);
+      testTextAttrs(ID, 37, attrs, defAttrs, 36, 44);
 
       tempElem = tempElem.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color};
-      testTextAttrs(ID, 50, attrs, defAttrs, 50, 57);
+      testTextAttrs(ID, 44, attrs, defAttrs, 44, 51);
 
       tempElem = tempElem.firstChild.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"font-weight": kBoldFontWeight,
                "color": gComputedStyle.color};
-      testTextAttrs(ID, 57, attrs, defAttrs, 57, 61);
+      testTextAttrs(ID, 51, attrs, defAttrs, 51, 55);
 
       tempElem = tempElem.parentNode;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color};
-      testTextAttrs(ID, 61, attrs, defAttrs, 61, 68);
+      testTextAttrs(ID, 55, attrs, defAttrs, 55, 62);
 
       //////////////////////////////////////////////////////////////////////////
       // area9, different single style spans in styled paragraph
       ID = "area9";
       defAttrs = buildDefaultTextAttrs(ID, "10pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       attrs = {};
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -59,16 +59,20 @@ const WIN = (navigator.platform.indexOf(
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible general
 
 const STATE_BUSY = nsIAccessibleStates.STATE_BUSY;
 
 const kEmbedChar = String.fromCharCode(0xfffc);
 
+const kDiscBulletText = String.fromCharCode(0x2022) + " ";
+const kCircleBulletText = String.fromCharCode(0x25e6) + " ";
+const kSquareBulletText = String.fromCharCode(0x25aa) + " ";
+
 /**
  * nsIAccessibleRetrieval, initialized when test is loaded.
  */
 var gAccRetrieval = null;
 
 /**
  * Invokes the given function when document is loaded and focused. Preferable
  * to mochitests 'addLoadEvent' function -- additionally ensures state of the
--- a/accessible/tests/mochitest/name/Makefile.in
+++ b/accessible/tests/mochitest/name/Makefile.in
@@ -49,15 +49,16 @@ include $(topsrcdir)/config/rules.mk
 		general.css \
 		general.xbl \
 		markup.js \
 		nsRootAcc_wnd.xul \
 		test_button.html \
 		test_general.html \
 		test_general.xul \
 		test_link.html \
+		test_list.html \
 		test_markup.html \
 		test_nsRootAcc.xul \
 		markuprules.xml \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/name/test_list.html
@@ -0,0 +1,91 @@
+<html>
+
+<head>
+  <title>nsIAccessible::name calculation for HTML li</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>
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../name.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+    /**
+     * Alter list item numbering and change list style type.
+     */
+    function bulletUpdate()
+    {
+      this.eventSeq = [
+        new invokerChecker(EVENT_REORDER, getNode("list"))
+      ];
+
+      this.invoke = function bulletUpdate_invoke()
+      {
+        testName("li_end", "1. list end");
+
+        var li = document.createElement("li");
+        li.setAttribute("id", "li_start");
+        li.textContent = "list start";
+        getNode("list").insertBefore(li, getNode("li_end"));
+      }
+
+      this.finalCheck = function bulletUpdate_finalCheck()
+      {
+        testName("li_start", "1. list start");
+        testName("li_end", "2. list end");
+
+        // change list style type
+        var list = getNode("list");
+        list.setAttribute("style", "list-style-type: disc;");
+        getComputedStyle(list, "").color; // make style processing sync
+
+        testName("li_start", kDiscBulletText + "list start");
+        testName("li_end", kDiscBulletText + "list end");
+      }
+
+      this.getID = function bulletUpdate_getID()
+      {
+        return "Update bullet of list items";
+      }
+    }
+
+    var gQueue = null;
+    function doTest()
+    {
+      gQueue = new eventQueue();
+      gQueue.push(new bulletUpdate());
+      gQueue.invoke(); // SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  </script>
+
+</head>
+
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=634200"
+     title="crash [@ nsIFrame::GetStyleVisibility() ]">
+    Mozilla Bug 634200
+  </a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <ol id="list">
+    <li id="li_end">list end</li>
+  </ol>
+
+</body>
+</html>
--- a/accessible/tests/mochitest/relations/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/relations/test_tabbrowser.xul
@@ -20,16 +20,17 @@
 
   <script type="application/javascript"
           src="../common.js" />
   <script type="application/javascript"
           src="../role.js" />
   <script type="application/javascript"
           src="../relations.js" />
 
+  <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     const Ci = Components.interfaces;
 
     // Hack to make xul:tabbrowser work.
@@ -55,18 +56,17 @@
                                               aStateFlags,
                                               aStatus)
        {
         if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
           testRelations();
        }
       };
 
-      tabBrowser.addProgressListener(progressListener,
-                                     Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
+      tabBrowser.addProgressListener(progressListener);
 
       tabBrowser.loadTabs(["about:", "about:mozilla"], false, true);
     }
 
     function testRelations()
     {
       //////////////////////////////////////////////////////////////////////////
       // 'labelled by'/'label for' relations for xul:tab and xul:tabpanel
@@ -74,17 +74,17 @@
       var tabs = getNode("tabbrowser").tabContainer.childNodes;
       var panels = getNode("tabbrowser").mTabBox.tabpanels.childNodes;
 
       testRelation(panels[0], RELATION_LABELLED_BY, tabs[0]);
       testRelation(tabs[0], RELATION_LABEL_FOR, panels[0]);
       testRelation(panels[1], RELATION_LABELLED_BY, tabs[1]);
       testRelation(tabs[1], RELATION_LABEL_FOR, panels[1]);
 
-      SimpleTest.finish()
+      SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   ]]>
   </script>
 
   <vbox flex="1" style="overflow: auto;">
--- a/accessible/tests/mochitest/text/test_hypertext.html
+++ b/accessible/tests/mochitest/text/test_hypertext.html
@@ -1,15 +1,21 @@
 <!DOCTYPE html>
 <html>
 <head>
   <title>nsIAccessibleText getText related function tests for rich text</title>
   <link rel="stylesheet" type="text/css"
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
+  <style>
+    h6.gencontent:before {
+      content: "aga"
+    }
+  </style>
+
   <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="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
@@ -35,16 +41,26 @@
       ////////////////////////////////////////////////////////////////////////
       // getText
 
       testText(IDs, 0, 1, "h");
       testText(IDs, 5, 7, " " + kEmbedChar);
       testText(IDs, 10, 13, "e " + kEmbedChar);
       testText(IDs, 0, 13, "hello " + kEmbedChar + " see " + kEmbedChar);
 
+      ////////////////////////////////////////////////////////////////////////
+      // getTextAtOffset line boundary
+
+      testTextAtOffset(0, BOUNDARY_LINE_START, "line ", 0, 5,
+                       "hypertext3", kOk, kOk, kOk);
+
+      // XXX: see bug 638684.
+      testTextAtOffset(0, BOUNDARY_LINE_START, "line ", 0, 5,
+                       "hypertext4", kTodo, kOk, kTodo);
+
       //////////////////////////////////////////////////////////////////////////
       // list
       //////////////////////////////////////////////////////////////////////////
 
       IDs = [ "list" ];
       testCharacterCount(IDs, 1);
       testText(IDs, 0, 1, kEmbedChar);
 
@@ -58,20 +74,39 @@
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 <body>
 
   <a target="_blank"
      title="Fix getText"
-     href="https://bugzilla.mozilla.org/show_bug.cgi?id=630001">Mozilla Bug 630001, part3</a>
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=630001">
+    Bug 630001, part3
+  </a>
+  <a target="_blank"
+     title="getTextAtOffset line boundary may return more than one line"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=638326">
+    Bug 638326
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <div id="hypertext">hello <a>friend</a> see <img></div>
   <div id="hypertext2">hello <a>friend</a> see <input></div>
   <ol id="list"><li id="listitem">foo</li></ol>
 
+  <div id="hypertext3">line
+<!-- haha -->
+<!-- hahaha -->
+<h6>heading</h6>
+  </div>
+
+  <div id="hypertext4">line
+<!-- haha -->
+<!-- hahaha -->
+<h6 role="presentation" class="gencontent">heading</h6>
+  </div>
+
 </body>
 </html>
--- a/accessible/tests/mochitest/text/test_words.html
+++ b/accessible/tests/mochitest/text/test_words.html
@@ -1,12 +1,13 @@
 <!DOCTYPE html>
 <html>
 <head>
   <title>nsIAccessibleText getText related function tests for html:input,html:div and html:textarea</title>
+  <meta charset="utf-8" />
   <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="../common.js"></script>
@@ -60,17 +61,17 @@
 
       // "3.1416"
       testWords("div11", ["3.1416"], kTodo);
 
       // "4,261.01"
       testWords("div12", ["4,261.01"], kTodo);
 
       // "カタカナ"
-      testWords("div13", ["カタカナ"], kTodo);
+      testWords("div13", ["カタカナ"], kOk);
 
       // "Peter's car"
       testWords("div14", ["Peter's", "car"], kTodo);
 
       // "N.A.T.O."
       testWords("div15", ["N.A.T.O."], kTodo);
 
       // "3+4*5=23"
--- a/accessible/tests/mochitest/tree/test_cssoverflow.html
+++ b/accessible/tests/mochitest/tree/test_cssoverflow.html
@@ -32,25 +32,29 @@
     {
       this.linkNode = getNode(aID);
       this.link = getAccessible(this.linkNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
       ];
 
+      this.unexpectedEventSeq = [
+        new invokerChecker(EVENT_REORDER, this.linkNode.parentNode)
+      ];
+
       this.invoke = function focusAnchor_invoke()
       {
         this.linkNode.focus();
       }
 
       this.check = function focusAnchor_check(aEvent)
       {
-        isnot(this.link, aEvent.accessible,
-              "Focus should be fired against new link accessible!");
+        is(this.link, aEvent.accessible,
+           "The link accessible shouldn't be recreated!");
       }
 
       this.getID = function focusAnchor_getID()
       {
         return "focus a:focus{overflow:scroll} #1";
       }
     }
 
@@ -58,25 +62,29 @@
     {
       this.linkNode = getNode(aID);
       this.link = getAccessible(this.linkNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
       ];
 
+      this.unexpectedEventSeq = [
+        new invokerChecker(EVENT_REORDER, this.linkNode.parentNode)
+      ];
+
       this.invoke = function tabAnchor_invoke()
       {
         synthesizeKey("VK_TAB", { shiftKey: false });
       }
 
       this.check = function tabAnchor_check(aEvent)
       {
-        isnot(this.link, aEvent.accessible,
-              "Focus should be fired against new link accessible!");
+        is(this.link, aEvent.accessible,
+           "The link accessible shouldn't be recreated!");
       }
 
       this.getID = function tabAnchor_getID()
       {
         return "focus a:focus{overflow:scroll} #2";
       }
     }
 
@@ -114,16 +122,21 @@
      title="mochitest for bug 413777: focus the a:focus {overflow: scroll;} shouldn't recreate HTML a accessible">
     Mozilla Bug 591163
   </a><br>
   <a target="_blank"
      title="Rework accessible tree update code"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275">
     Mozilla Bug 570275
   </a><br>
+  <a target="_blank"
+     title="Don't recreate frames for inlines with overflow style applied"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=606087">
+    Mozilla Bug 606087
+  </a><br>
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
   <div id="eventdump"></div>
 
   <div>
--- a/accessible/tests/mochitest/tree/test_list.html
+++ b/accessible/tests/mochitest/tree/test_list.html
@@ -35,51 +35,47 @@
       if (aSubtree)
         obj.children.push(aSubtree);
 
       return obj;
     }
 
     function doTest()
     {
-      const discBulletText = String.fromCharCode(0x2022) + " ";
-      const circleBulletText = String.fromCharCode(0x25e6) + " ";
-      const squareBulletText = String.fromCharCode(0x25aa) + " ";
-
       // list1
       var discAccTree = {
         role: ROLE_LIST,
         children: [
-          new listItemTree(discBulletText, "Oranges"),
-          new listItemTree(discBulletText, "Apples"),
-          new listItemTree(discBulletText, "Bananas")
+          new listItemTree(kDiscBulletText, "Oranges"),
+          new listItemTree(kDiscBulletText, "Apples"),
+          new listItemTree(kDiscBulletText, "Bananas")
         ]
       };
 
       testAccessibleTree("list1", discAccTree);
 
       // list2
       var circleAccTree = {
         role: ROLE_LIST,
         children: [
-          new listItemTree(circleBulletText, "Oranges"),
-          new listItemTree(circleBulletText, "Apples"),
-          new listItemTree(circleBulletText, "Bananas")
+          new listItemTree(kCircleBulletText, "Oranges"),
+          new listItemTree(kCircleBulletText, "Apples"),
+          new listItemTree(kCircleBulletText, "Bananas")
         ]
       };
 
       testAccessibleTree("list2", circleAccTree);
 
       // list3
       var squareAccTree = {
         role: ROLE_LIST,
         children: [
-          new listItemTree(squareBulletText, "Oranges"),
-          new listItemTree(squareBulletText, "Apples"),
-          new listItemTree(squareBulletText, "Bananas")
+          new listItemTree(kSquareBulletText, "Oranges"),
+          new listItemTree(kSquareBulletText, "Apples"),
+          new listItemTree(kSquareBulletText, "Bananas")
         ]
       };
 
       testAccessibleTree("list3", squareAccTree);
 
       // list4
       var nestedAccTree = {
         role: ROLE_LIST,
@@ -87,16 +83,53 @@
           new listItemTree("1. ", "Oranges"),
           new listItemTree("2. ", "Apples"),
           new listItemTree("3. ", "Bananas", circleAccTree)
         ]
       };
 
       testAccessibleTree("list4", nestedAccTree);
 
+      // dl list
+      var tree =
+        { LIST: [ // dl
+          { LISTITEM: [ // dt
+            { TEXT_LEAF: [] },
+          ] },
+          { PARAGRAPH: [ // dd
+            { TEXT_LEAF: [] }
+          ] },
+          { LISTITEM: [ // dt
+            { TEXT_LEAF: [] }
+          ] },
+          { PARAGRAPH: [ // dd
+            { TEXT_LEAF: [] }
+          ] }
+        ] };
+
+      testAccessibleTree("list5", tree);
+
+      // dl list inside ordered list
+      tree =
+        { LIST: [ // ol
+          { LISTITEM: [ // li
+            { STATICTEXT: [ ] },
+            { LIST: [ // dl
+              { LISTITEM: [ // dt
+                { TEXT_LEAF: [] }
+              ] },
+              { PARAGRAPH: [ // dd
+                { TEXT_LEAF: [] }
+              ] }
+            ] }
+          ] }
+        ] };
+
+      testAccessibleTree("list6", tree);
+
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 <body>
@@ -106,16 +139,21 @@
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045">
     Mozilla Bug 342045
   </a>
   <a target="_blank"
      title="Bullets of nested not ordered lists have one and the same character."
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=604587">
     Mozilla Bug 604587
   </a>
+  <a target="_blank"
+     title="Fix list bullets for DL list (crash [@ nsBulletFrame::GetListItemText])"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=629114">
+    Mozilla Bug 629114
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <ul id="list1">
     <li id="l1_li1">Oranges</li>
     <li id="l1_li2">Apples</li>
@@ -139,10 +177,23 @@
     <li id="li5">Apples</li>
     <li id="li6">Bananas<ul>
         <li id="n_li4">Oranges</li>
         <li id="n_li5">Apples</li>
         <li id="n_li6">Bananas</li>
       </ul>
     </li>
   </ol>
+
+  <dl id="list5">
+    <dt>item1</dt><dd>description</dd>
+    <dt>item2</td><dd>description</dd>
+  </dl>
+
+  <ol id="list6">
+    <li>
+      <dl id="dl">
+        <dt>item1</dt><dd>description</dd>
+      </dl>
+    </li>
+  </ol>
 </body>
 </html>
--- a/accessible/tests/mochitest/tree/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/tree/test_tabbrowser.xul
@@ -19,16 +19,17 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
           src="../common.js" />
   <script type="application/javascript"
           src="../role.js" />
 
+  <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     const Ci = Components.interfaces;
 
     // Hack to make xul:tabbrowser work.
@@ -55,18 +56,17 @@
         {
           if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
             tabBrowser.removeProgressListener(progressListener);
 
             SimpleTest.executeSoon(testAccTree);
           }
         }
       };
-      tabBrowser.addProgressListener(progressListener,
-                                     Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
+      tabBrowser.addProgressListener(progressListener);
 
       // Test XUL and HTML documents.
       tabBrowser.loadTabs(["about:", "about:mozilla"], false, true);
     }
 
     function testAccTree()
     {
       var tabBrowser = document.getElementById("tabbrowser");
@@ -201,17 +201,17 @@
               }
             ]
           }
         ]
       };
 
       testAccessibleTree(tabBrowser.mTabBox.tabpanels, tabboxAccTree);
 
-      SimpleTest.finish()
+      SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   ]]>
   </script>
 
   <vbox flex="1" style="overflow: auto;">
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -7,16 +7,17 @@ builtin(include, build/autoconf/glib.m4)
 builtin(include, build/autoconf/libIDL.m4)dnl
 builtin(include, build/autoconf/nspr.m4)dnl
 builtin(include, build/autoconf/nss.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/freetype2.m4)dnl
 builtin(include, build/autoconf/codeset.m4)dnl
 builtin(include, build/autoconf/altoptions.m4)dnl
 builtin(include, build/autoconf/mozprog.m4)dnl
+builtin(include, build/autoconf/mozheader.m4)dnl
 builtin(include, build/autoconf/acwinpaths.m4)dnl
 
 MOZ_PROG_CHECKMSYS()
 
 # Read the user's .mozconfig script.  We can't do this in
 # configure.in: autoconf puts the argument parsing code above anything
 # expanded from configure.in, and we need to get the configure options
 # from .mozconfig in place before that argument parsing code.
--- a/allmakefiles.sh
+++ b/allmakefiles.sh
@@ -64,16 +64,17 @@ build/pgo/js-input/Makefile
 build/unix/Makefile
 build/win32/Makefile
 build/win32/crashinjectdll/Makefile
 config/Makefile
 config/autoconf.mk
 config/mkdepend/Makefile
 config/nspr/Makefile
 config/doxygen.cfg
+config/expandlibs_config.py
 config/tests/src-simple/Makefile
 probes/Makefile
 extensions/Makefile
 "
 
 if [ "$WINCE" ]; then
   add_makefiles "
     build/wince/tools/Makefile
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -119,26 +119,31 @@ APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
 else
 MOZILLA_INTERNAL_API = 1
 APP_XPCOM_LIBS = $(XPCOM_LIBS)
 endif
 
 LIBS += \
 	$(STATIC_COMPONENTS_LINKER_PATH) \
 	$(EXTRA_DSO_LIBS) \
-	$(MOZ_JS_LIBS) \
 	$(APP_XPCOM_LIBS) \
 	$(NSPR_LIBS) \
+	$(NULL)
+
+ifdef BUILD_STATIC_LIBS
+LIBS += \
+	$(MOZ_JS_LIBS) \
 	$(TK_LIBS) \
 	$(NULL)
 
 # Add explicit X11 dependency when building against X11 toolkits
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
 endif
+endif
 
 ifdef MOZ_JPROF
 LIBS += -ljprof
 endif
 
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
@@ -194,23 +199,16 @@ endif
 ifdef BUILD_STATIC_LIBS
 RCFLAGS += -DMOZ_STATIC_BUILD
 endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 endif
 
-ifeq ($(OS_ARCH),BeOS)
-BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
-ifdef BUILD_STATIC_LIBS
-OS_LIBS += -ltracker -lgame
-endif
-endif
-
 ifeq ($(OS_ARCH),OS2)
 RESFILE=splashos2.res
 RCFLAGS += -DMOZ_PHOENIX
 ifdef BUILD_STATIC_LIBS
 RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
 endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
@@ -245,18 +243,16 @@ ifndef GNU_CC
 LDFLAGS += /HEAP:0x40000
 ifeq ($(OS_TEST),x86_64)
 # set stack to 2MB on x64 build.  See bug 582910
 LDFLAGS += -STACK:2097152
 endif
 endif
 endif
 
-$(PROGRAM): $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-
 ifneq (,$(filter-out OS2 WINNT WINCE,$(OS_ARCH)))
 
 $(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS)
 	cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
 		-e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
 	chmod +x $@
 
 libs:: $(MOZ_APP_NAME)
deleted file mode 100644
index 145e9ca36dfca8072be0b28e2c1c6c93b6dff813..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -3,16 +3,23 @@
   <emItems>
     <emItem id="fdm_ffext@freedownloadmanager.org">
       <versionRange minVersion="1.0" maxVersion="1.3.1">
         <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
            <versionRange minVersion="3.0a1" maxVersion="*"/>
         </targetApplication>
       </versionRange>
     </emItem>
+    <emItem id="firefox@bandoo.com">
+      <versionRange minVersion="5.0" maxVersion="5.0" severity="1">
+        <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
+           <versionRange minVersion="3.7a1pre" maxVersion="*"/>
+        </targetApplication>
+      </versionRange>
+    </emItem>
     <emItem id="langpack-vi-VN@firefox.mozilla.org">
       <versionRange minVersion="2.0" maxVersion="2.0"/>
     </emItem>
     <emItem id="masterfiler@gmail.com">
       <versionRange severity="3"/>
     </emItem>
     <emItem id="mozilla_cc@internetdownloadmanager.com">
       <versionRange minVersion=" " maxVersion="6.9.8">
@@ -65,23 +72,37 @@
     </emItem>
     <emItem id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
       <versionRange minVersion="1.2" maxVersion="1.2">
         <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
            <versionRange minVersion="3.0a1" maxVersion="*"/>
         </targetApplication>
       </versionRange>
     </emItem>
+    <emItem id="{6E19037A-12E3-4295-8915-ED48BC341614}">
+      <versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
+        <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
+           <versionRange minVersion="3.7a1pre" maxVersion="*"/>
+        </targetApplication>
+      </versionRange>
+    </emItem>
     <emItem id="{8CE11043-9A15-4207-A565-0C94C42D590D}"/>
     <emItem id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
-      <versionRange severity="1"/>
+      <versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1"/>
     </emItem>
     <emItem id="{B13721C7-F507-4982-B2E5-502A71474FED}">
       <versionRange severity="1"/>
     </emItem>
+    <emItem id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
+      <versionRange minVersion="0.1" maxVersion="3.3.0.*">
+        <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
+           <versionRange minVersion="3.7a1" maxVersion="*"/>
+        </targetApplication>
+      </versionRange>
+    </emItem>
     <emItem id="{E8E88AB0-7182-11DF-904E-6045E0D72085}"/>
   </emItems>
 <pluginItems>
   <pluginItem>
     <match name="name" exp="^Yahoo Application State Plugin$"/>
     <match name="description" exp="^Yahoo Application State Plugin$"/>
     <match name="filename" exp="npYState.dll"/>
     <versionRange>
@@ -127,9 +148,41 @@
     <match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]"/>
     <versionRange>
       <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
         <versionRange minVersion="3.6a1pre" maxVersion="*"/>
       </targetApplication>
     </versionRange>
   </pluginItem>
 </pluginItems>
+<gfxItems>
+  <gfxBlacklistEntry>
+    <os>WINNT 6.1</os>
+    <vendor>0x10de</vendor>
+    <devices>
+      <device>0x0a6c</device>
+    </devices>
+    <feature>DIRECT2D</feature>
+    <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
+    <driverVersion>8.17.12.5896</driverVersion>
+    <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
+  </gfxBlacklistEntry>
+  <gfxBlacklistEntry>
+    <os>WINNT 6.1</os>
+    <vendor>0x10de</vendor>
+    <devices>
+      <device>0x0a6c</device>
+    </devices>
+    <feature>DIRECT3D_9_LAYERS</feature>
+    <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
+    <driverVersion>8.17.12.5896</driverVersion>
+    <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
+  </gfxBlacklistEntry>
+  <gfxBlacklistEntry>
+    <os>WINNT 5.1</os>
+    <vendor>0x10de</vendor>
+    <feature>DIRECT3D_9_LAYERS</feature>
+    <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
+    <driverVersion>7.0.0.0</driverVersion>
+    <driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
+  </gfxBlacklistEntry>
+</gfxItems>
 </blocklist>
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -43,18 +43,16 @@
 #  The first character after a period must be alphabetic.
 
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
 #define UNIX_BUT_NOT_MAC
 #endif
 #endif
 
-pref("general.startup.browser", true);
-
 pref("browser.chromeURL","chrome://browser/content/");
 pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindow.xul");
 
 // Enables some extra Extension System Logging (can reduce performance)
 pref("extensions.logging.enabled", false);
 
 // Preferences for AMO integration
 pref("extensions.getAddons.cache.enabled", true);
@@ -531,21 +529,16 @@ pref("mousewheel.withaltkey.numlines",1)
 pref("mousewheel.withmetakey.action",0);
 pref("mousewheel.withmetakey.sysnumlines",true);
 pref("mousewheel.withmetakey.numlines",1);
 #endif
 pref("mousewheel.withcontrolkey.action",3);
 pref("mousewheel.withcontrolkey.sysnumlines",false);
 pref("mousewheel.withcontrolkey.numlines",1);
 
-pref("profile.allow_automigration", false);   // setting to false bypasses automigration in the profile code
-
-// Customizable toolbar stuff
-pref("custtoolbar.personal_toolbar_folder", "");
-
 // pref to control the alert notification 
 pref("alerts.slideIncrement", 1);
 pref("alerts.slideIncrementTime", 10);
 pref("alerts.totalOpenTime", 4000);
 
 pref("browser.xul.error_pages.enabled", true);
 pref("browser.xul.error_pages.expert_bad_cert", false);
 
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -166,16 +166,19 @@ var StarUI = {
     }
 
     var loadObserver = {
       _self: this,
       _itemId: aItemId,
       _anchorElement: aAnchorElement,
       _position: aPosition,
       observe: function (aSubject, aTopic, aData) {
+        //XXX We just caused localstore.rdf to be re-applied (bug 640158)
+        retrieveToolbarIconsizesFromTheme();
+
         this._self._overlayLoading = false;
         this._self._overlayLoaded = true;
         this._self._doShowEditBookmarkPanel(this._itemId, this._anchorElement,
                                             this._position);
       }
     };
     this._overlayLoading = true;
     document.loadOverlay("chrome://browser/content/places/editBookmarkOverlay.xul",
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1391,16 +1391,17 @@ function prepareForStartup() {
   } catch (e) {
     alert("Error launching browser window:" + e);
     window.close(); // Give up.
     return;
   }
 
   // initialize observers and listeners
   // and give C++ access to gBrowser
+  gBrowser.init();
   XULBrowserWindow.init();
   window.QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(nsIWebNavigation)
         .QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
         .QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(Ci.nsIXULWindow)
         .XULBrowserWindow = window.XULBrowserWindow;
   window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow =
@@ -1433,17 +1434,17 @@ function prepareForStartup() {
   // enable global history
   try {
     gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;
   } catch(ex) {
     Components.utils.reportError("Places database may be locked: " + ex);
   }
 
   // hook up UI through progress listener
-  gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+  gBrowser.addProgressListener(window.XULBrowserWindow);
   gBrowser.addTabsProgressListener(window.TabsProgressListener);
 
   // setup our common DOMLinkAdded listener
   gBrowser.addEventListener("DOMLinkAdded", DOMLinkHandler, false);
 
   // setup our MozApplicationManifest listener
   gBrowser.addEventListener("MozApplicationManifest",
                             OfflineApps, false);
@@ -3346,22 +3347,20 @@ const BrowserSearch = {
 
     // getSubmission can return null if the engine doesn't have a URL
     // with a text/html response type.  This is unlikely (since
     // SearchService._addEngineToStore() should fail for such an engine),
     // but let's be on the safe side.
     if (!submission)
       return;
 
-    if (useNewTab) {
-      gBrowser.loadOneTab(submission.uri.spec, {
-                          postData: submission.postData,
-                          relatedToCurrent: true});
-    } else
-      loadURI(submission.uri.spec, null, submission.postData, false);
+    openLinkIn(submission.uri.spec,
+               useNewTab ? "tab" : "current",
+               { postData: submission.postData,
+                 relatedToCurrent: true });
   },
 
   /**
    * Returns the search bar element if it is present in the toolbar, null otherwise.
    */
   get searchBar() {
     return document.getElementById("searchbar");
   },
@@ -4251,24 +4250,20 @@ var XULBrowserWindow = {
           this.throbberElement.setAttribute("busy", "true");
 
         // 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) {
-        if (aWebProgress.DOMWindow == content) {
-          if (aRequest)
-            this.endDocumentLoad(aRequest, aStatus);
-          if (!gBrowser.mTabbedMode && !gBrowser.getIcon())
-            gBrowser.useDefaultIcon(gBrowser.selectedTab);
-        }
-      }
+      if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK &&
+          aWebProgress.DOMWindow == content &&
+          aRequest)
+        this.endDocumentLoad(aRequest, aStatus);
 
       // This (thanks to the filter) is a network stop or the last
       // request stop outside of loading the document, stop throbbers
       // and progress bars and such
       if (aRequest) {
         let msg = "";
         let location;
         // Get the URI either from a channel or a pseudo-object
@@ -4394,19 +4389,16 @@ var XULBrowserWindow = {
       if ((location == "about:blank" && !content.opener) ||
           location == "") {  // Second condition is for new tabs, otherwise
                              // reload function is enabled until tab is refreshed.
         this.reloadCommand.setAttribute("disabled", "true");
       } else {
         this.reloadCommand.removeAttribute("disabled");
       }
 
-      if (!gBrowser.mTabbedMode && aWebProgress.isLoadingDocument)
-        gBrowser.setIcon(gBrowser.selectedTab, null);
-
       if (gURLBar) {
         // Strip off "wyciwyg://" and passwords for the location bar
         let uri = aLocationURI;
         try {
           uri = this._uriFixup.createExposableURI(uri);
         } catch (e) {}
         URLBarSetURI(uri);
 
@@ -5071,33 +5063,29 @@ var TabsInTitlebar = {
     let docElement = document.documentElement;
     if (allowed == (docElement.getAttribute("tabsintitlebar") == "true"))
       return;
 
     function $(id) document.getElementById(id);
     let titlebar = $("titlebar");
 
     if (allowed) {
-      let availTop = screen.availTop;
-      function top(ele)    ele.boxObject.screenY - availTop;
-      function bottom(ele) top(ele) + rect(ele).height;
       function rect(ele)   ele.getBoundingClientRect();
 
       let tabsToolbar       = $("TabsToolbar");
+
       let appmenuButtonBox  = $("appmenu-button-container");
       let captionButtonsBox = $("titlebar-buttonbox");
-
       this._sizePlaceholder("appmenu-button", rect(appmenuButtonBox).width);
       this._sizePlaceholder("caption-buttons", rect(captionButtonsBox).width);
 
-      let maxMargin = top(gNavToolbox);
-      let tabsBottom = maxMargin + rect(tabsToolbar).height;
-      let titlebarBottom = Math.max(bottom(appmenuButtonBox), bottom(captionButtonsBox));
-      let distance = tabsBottom - titlebarBottom;
-      titlebar.style.marginBottom = - Math.min(distance, maxMargin) + "px";
+      let tabsToolbarRect = rect(tabsToolbar);
+      let titlebarTop = rect($("titlebar-content")).top;
+      titlebar.style.marginBottom = - Math.min(tabsToolbarRect.top - titlebarTop,
+                                               tabsToolbarRect.height) + "px";
 
       docElement.setAttribute("tabsintitlebar", "true");
 
       if (!this._draghandle) {
         let tmp = {};
         Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
         this._draghandle = new tmp.WindowDraggingElement(tabsToolbar, window);
         this._draghandle.mouseDownCheck = function () {
@@ -8513,18 +8501,27 @@ XPCOMUtils.defineLazyGetter(this, "HUDCo
 
 // 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 restartText = gNavigatorBundle.getString("safeModeRestartButton");
+  let buttonFlags = (Services.prompt.BUTTON_POS_0 *
+                     Services.prompt.BUTTON_TITLE_IS_STRING) +
+                    (Services.prompt.BUTTON_POS_1 *
+                     Services.prompt.BUTTON_TITLE_CANCEL) +
+                    Services.prompt.BUTTON_POS_0_DEFAULT;
+
+  let rv = Services.prompt.confirmEx(window, promptTitle, promptMessage,
+                                     buttonFlags, restartText, null, null,
+                                     null, {});
+  if (rv == 0) {
     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|.
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -129,23 +129,20 @@
       </field>
       <field name="mProgressListeners">
         []
       </field>
       <field name="mTabsProgressListeners">
         []
       </field>
       <field name="mTabListeners">
-        new Array()
+        []
       </field>
       <field name="mTabFilters">
-        new Array()
-      </field>
-      <field name="mTabbedMode">
-        false
+        []
       </field>
       <field name="mIsBusy">
         false
       </field>
       <field name="arrowKeysShouldWrap" readonly="true">
 #ifdef XP_MACOSX
         true
 #else
@@ -1059,57 +1056,16 @@
             if (aTab.selected)
               this.updateTitlebar();
 
             return true;
           ]]>
         </body>
       </method>
 
-      <method name="enterTabbedMode">
-        <body>
-          <![CDATA[
-            if (this.mTabbedMode)
-              return;
-
-            this.mTabbedMode = true; // Welcome to multi-tabbed mode.
-
-            if (XULBrowserWindow.isBusy) {
-              this.mCurrentTab.setAttribute("busy", "true");
-              this.mIsBusy = true;
-              this.setTabTitleLoading(this.mCurrentTab);
-            } else {
-              this.setIcon(this.mCurrentTab, this.mCurrentBrowser.mIconURL);
-            }
-
-            var filter;
-            if (this.mTabFilters.length > 0) {
-              // Use the filter hooked up in our addProgressListener
-              filter = this.mTabFilters[0];
-            } else {
-              // create a filter and hook it up to our first browser
-              filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
-                                 .createInstance(Components.interfaces.nsIWebProgress);
-              this.mTabFilters[0] = filter;
-              this.mCurrentBrowser.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
-            }
-
-            // Remove all our progress listeners from the active browser's filter.
-            this.mProgressListeners.forEach(filter.removeProgressListener, filter);
-
-            // Wire up a progress listener to our filter.
-            const listener = this.mTabProgressListener(this.mCurrentTab,
-                                                       this.mCurrentBrowser,
-                                                       false);
-            filter.addProgressListener(listener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
-            this.mTabListeners[0] = listener;
-          ]]>
-        </body>
-      </method>
-
       <method name="loadOneTab">
         <parameter name="aURI"/>
         <parameter name="aReferrerURI"/>
         <parameter name="aCharset"/>
         <parameter name="aPostData"/>
         <parameter name="aLoadInBackground"/>
         <parameter name="aAllowThirdPartyFixup"/>
         <body>
@@ -1223,18 +1179,16 @@
               aAllowThirdPartyFixup = params.allowThirdPartyFixup;
               aFromExternal         = params.fromExternal;
               aRelatedToCurrent     = params.relatedToCurrent;
               aSkipAnimation        = params.skipAnimation;
             }
 
             this._browsers = null; // invalidate cache
 
-            this.enterTabbedMode();
-
             // if we're adding tabs, we're past interrupt mode, ditch the owner
             if (this.mCurrentTab.owner)
               this.mCurrentTab.owner = null;
 
             var t = document.createElementNS(
               "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
                                              "tab");
 
@@ -1861,70 +1815,48 @@
           <![CDATA[
             this.getBrowserForTab(aTab).reload();
           ]]>
         </body>
       </method>
 
       <method name="addProgressListener">
         <parameter name="aListener"/>
-        <parameter name="aMask"/>
         <body>
           <![CDATA[
+            if (arguments.length != 1) {
+              Components.utils.reportError("gBrowser.addProgressListener was " +
+                                           "called with a second argument, " +
+                                           "which is not supported. See bug " +
+                                           "608628.");
+            }
+
             if (!this.mAddProgressListenerWasCalled) {
               this.mAddProgressListenerWasCalled = true;
               this.tabContainer.updateVisibility();
             }
 
-            if (this.mProgressListeners.length == 1) {
-              // If we are adding a 2nd progress listener, we need to enter tabbed mode
-              // because the browser status filter can only handle one progress listener.
-              // In tabbed mode, mTabProgressListener is used which will iterate over all listeners.
-              this.enterTabbedMode();
-            }
-
             this.mProgressListeners.push(aListener);
-
-            if (!this.mTabbedMode) {
-              // If someone does this:
-              // addProgressListener, removeProgressListener, addProgressListener
-              // don't create a new filter; reuse the existing filter.
-              if (this.mTabFilters.length == 0) {
-                // hook a filter up to our first browser
-                const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
-                                         .createInstance(Components.interfaces.nsIWebProgress);
-                this.mTabFilters[0] = filter;
-                this.mCurrentBrowser.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
-              }
-
-              // Directly hook the listener up to the filter for better performance
-              this.mTabFilters[0].addProgressListener(aListener, aMask);
-            }
           ]]>
         </body>
       </method>
 
       <method name="removeProgressListener">
         <parameter name="aListener"/>
         <body>
           <![CDATA[
             this.mProgressListeners =
               this.mProgressListeners.filter(function (l) l != aListener);
-
-            if (!this.mTabbedMode)
-              // Don't forget to remove it from the filter we hooked it up to
-              this.mTabFilters[0].removeProgressListener(aListener);
          ]]>
         </body>
       </method>
 
       <method name="addTabsProgressListener">
         <parameter name="aListener"/>
         <body>
-          this.enterTabbedMode();
           this.mTabsProgressListeners.push(aListener);
         </body>
       </method>
 
       <method name="removeTabsProgressListener">
         <parameter name="aListener"/>
         <body>
         <![CDATA[
@@ -2484,19 +2416,43 @@
 
           // set up the shared autoscroll popup
           this._autoScrollPopup = this.mCurrentBrowser._createAutoScrollPopup();
           this._autoScrollPopup.id = "autoscroller";
           this.appendChild(this._autoScrollPopup);
           this.mCurrentBrowser.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
           this.mCurrentBrowser.droppedLinkHandler = handleDroppedLink;
           this.updateWindowResizers();
+
+          // Hook up the event listeners to the first browser
+          var tabListener = this.mTabProgressListener(this.mCurrentTab, this.mCurrentBrowser, true);
+          const nsIWebProgress = Components.interfaces.nsIWebProgress;
+          const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
+                                   .createInstance(nsIWebProgress);
+          filter.addProgressListener(tabListener, nsIWebProgress.NOTIFY_ALL);
+          this.mTabListeners[0] = tabListener;
+          this.mTabFilters[0] = filter;
+          this.init();
         ]]>
       </constructor>
 
+      <method name="init">
+        <body><![CDATA[
+          if (!this._initialProgressListenerAdded) {
+            this._initialProgressListenerAdded = true;
+            try {
+              this.webProgress.addProgressListener(this.mTabFilters[0], Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+            } catch (e) {
+              // The binding was constructed too early, need to try this again later. See bug 463384.
+              this._initialProgressListenerAdded = false;
+            }
+          }
+        ]]></body>
+      </method>
+
       <destructor>
         <![CDATA[
           for (var i = 0; i < this.mTabListeners.length; ++i) {
             let browser = this.getBrowserAtIndex(i);
             if (browser.registeredOpenURI) {
               this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
               delete browser.registeredOpenURI;
             }
@@ -2506,16 +2462,23 @@
             this.mTabListeners[i].destroy();
             this.mTabListeners[i] = null;
           }
           document.removeEventListener("keypress", this, false);
         ]]>
       </destructor>
 
       <!-- Deprecated stuff, implemented for backwards compatibility. -->
+      <method name="enterTabbedMode">
+        <body>
+          Application.console.log("enterTabbedMode is an obsolete method and " +
+                                  "will be removed in a future release.");
+        </body>
+      </method>
+      <field name="mTabbedMode" readonly="true">true</field>
       <method name="setStripVisibilityTo">
         <parameter name="aShow"/>
         <body>
           this.tabContainer.visible = aShow;
         </body>
       </method>
       <method name="getStripVisibility">
         <body>
@@ -2762,19 +2725,16 @@
       <property name="visible"
                 onget="return !this._container.collapsed;">
         <setter><![CDATA[
           if (val == this.visible)
             return val;
 
           this._container.collapsed = !val;
 
-          if (val)
-            this.tabbrowser.enterTabbedMode();
-
           document.getElementById("menu_closeWindow").hidden = !val;
           document.getElementById("menu_close").setAttribute("label",
             this.tabbrowser.mStringBundle.getString(val ? "tabs.closeTab" : "tabs.close"));
 
           if (window.TabsInTitlebar)
             TabsInTitlebar.allowedBy("tabs-visible", val);
 
           return val;
--- a/browser/base/content/tabview/drag.js
+++ b/browser/base/content/tabview/drag.js
@@ -97,16 +97,23 @@ function Drag(item, event, isFauxDrag) {
     } else if (this.item.isATabItem) {
       UI.setActiveTab(this.item);
     }
   }
 };
 
 Drag.prototype = {
   // ----------
+  // Function: toString
+  // Prints [Drag (item)] for debug use
+  toString: function Drag_toString() {
+    return "[Drag (" + this.item + ")]";
+  },
+
+  // ----------
   // Function: snapBounds
   // Adjusts the given bounds according to the currently active trenches. Used by <Drag.snap>
   //
   // Parameters:
   //   bounds             - (<Rect>) bounds
   //   stationaryCorner   - which corner is stationary? by default, the top left in LTR mode,
   //                        and top right in RTL mode.
   //                        "topleft", "bottomleft", "topright", "bottomright"
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -79,16 +79,17 @@ function GroupItem(listOfEls, options) {
   this._isStacked = false;
   this.expanded = null;
   this.topChild = null;
   this.hidden = false;
   this.fadeAwayUndoButtonDelay = 15000;
   this.fadeAwayUndoButtonDuration = 300;
 
   this.keepProportional = false;
+  this._frozenItemSizeData = {};
 
   // Double click tracker
   this._lastClick = 0;
   this._lastClickPositions = null;
 
   // Variable: _activeTab
   // The <TabItem> for the groupItem's active tab.
   this._activeTab = null;
@@ -189,16 +190,17 @@ function GroupItem(listOfEls, options) {
   this.$title
     .blur(function() {
       self._titleFocused = false;
       self.$titleShield.show();
       if (self.getTitle())
         gTabView.firstUseExperienced = true;
     })
     .focus(function() {
+      self._unfreezeItemSize();
       if (!self._titleFocused) {
         (self.$title)[0].select();
         self._titleFocused = true;
       }
     })
     .mousedown(function(e) {
       e.stopPropagation();
     })
@@ -277,16 +279,23 @@ function GroupItem(listOfEls, options) {
   this.save();
 
   GroupItems.updateGroupCloseButtons();
 };
 
 // ----------
 GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
   // ----------
+  // Function: toString
+  // Prints [GroupItem id=id] for debug use
+  toString: function GroupItem_toString() {
+    return "[GroupItem id=" + this.id + "]";
+  },
+
+  // ----------
   // Variable: defaultName
   // The prompt text for the title field.
   defaultName: tabviewString('groupItem.defaultName'),
 
   // -----------
   // Function: setActiveTab
   // Sets the active <TabItem> for this groupItem; can be null, but only
   // if there are no children.
@@ -632,16 +641,19 @@ GroupItem.prototype = Utils.extend(new I
   //   options - An object with optional settings for this call.
   //
   // Options:
   //   immediately - (bool) if true, no animation will be used
   close: function GroupItem_close(options) {
     this.removeAll({dontClose: true});
     GroupItems.unregister(this);
 
+    // remove unfreeze event handlers, if item size is frozen
+    this._unfreezeItemSize({dontArrange: true});
+
     let self = this;
     let destroyGroup = function () {
       iQ(self.container).remove();
       if (self.$undoContainer) {
         self.$undoContainer.remove();
         self.$undoContainer = null;
       }
       self.removeTrenches();
@@ -665,16 +677,17 @@ GroupItem.prototype = Utils.extend(new I
     this.deleteData();
   },
 
   // ----------
   // Function: closeAll
   // Closes the groupItem and all of its children.
   closeAll: function GroupItem_closeAll() {
     if (this._children.length > 0) {
+      this._unfreezeItemSize();
       this._children.forEach(function(child) {
         iQ(child.container).hide();
       });
 
       iQ(this.container).animate({
          opacity: 0,
          "-moz-transform": "scale(.3)",
       }, {
@@ -866,18 +879,20 @@ GroupItem.prototype = Utils.extend(new I
   // ----------
   // Function: _createUndoButton
   // Makes the affordance for undo a close group action
   _createUndoButton: function GroupItem__createUndoButton() {
     let self = this;
     this.$undoContainer = iQ("<div/>")
       .addClass("undo")
       .attr("type", "button")
+      .appendTo("body");
+    iQ("<span/>")
       .text(tabviewString("groupItem.undoCloseGroup"))
-      .appendTo("body");
+      .appendTo(this.$undoContainer);
     let undoClose = iQ("<span/>")
       .addClass("close")
       .appendTo(this.$undoContainer);
 
     this.$undoContainer.css({
       left: this.bounds.left + this.bounds.width/2 - iQ(self.$undoContainer).width()/2,
       top:  this.bounds.top + this.bounds.height/2 - iQ(self.$undoContainer).height()/2,
       "-moz-transform": "scale(.1)",
@@ -995,18 +1010,23 @@ GroupItem.prototype = Utils.extend(new I
       item.setZ(this.getZ() + 1);
       $el.addClass("tabInGroupItem");
 
       if (!wasAlreadyInThisGroupItem) {
         item.droppable(false);
         item.groupItemData = {};
 
         item.addSubscriber(this, "close", function() {
+          let count = self._children.length;
+          let dontArrange = self.expanded || !self.shouldStack(count);
           let dontClose = !item.closedManually && gBrowser._numPinnedTabs > 0;
-          self.remove(item, { dontClose: dontClose });
+          self.remove(item, {dontArrange: dontArrange, dontClose: dontClose});
+
+          if (dontArrange)
+            self._freezeItemSize(count);
 
           if (self._children.length > 0 && self._activeTab) {
             GroupItems.setActiveGroupItem(self);
             UI.setActiveTab(self._activeTab);
           }
         });
 
         item.setParent(this);
@@ -1023,16 +1043,17 @@ GroupItem.prototype = Utils.extend(new I
         if (item.tab == gBrowser.selectedTab || 
             (!GroupItems.getActiveGroupItem() && !item.tab.hidden))
           GroupItems.setActiveGroupItem(this);
       }
 
       if (!options.dontArrange)
         this.arrange({animate: !options.immediately});
 
+      this._unfreezeItemSize({dontArrange: true});
       this._sendToSubscribers("childAdded",{ groupItemId: this.id, item: item });
 
       UI.setReorderTabsOnHide(this);
     } catch(e) {
       Utils.log('GroupItem.add error', e);
     }
   },
 
@@ -1093,18 +1114,20 @@ GroupItem.prototype = Utils.extend(new I
       // if a blank tab is selected while restoring a tab the blank tab gets
       // removed. we need to keep the group alive for the restored tab.
       if (item.tab._tabViewTabIsRemovedAfterRestore)
         options.dontClose = true;
 
       let closed = options.dontClose ? false : this.closeIfEmpty();
       if (closed)
         this._makeClosestTabActive();
-      else if (!options.dontArrange)
+      else if (!options.dontArrange) {
         this.arrange({animate: !options.immediately});
+        this._unfreezeItemSize({dontArrange: true});
+      }
 
       this._sendToSubscribers("childRemoved",{ groupItemId: this.id, item: item });
     } catch(e) {
       Utils.log(e);
     }
   },
 
   // ----------
@@ -1226,16 +1249,76 @@ GroupItem.prototype = Utils.extend(new I
  
     let shouldStack = arrObj.childWidth < TabItems.minTabWidth * 1.35;
     this._columns = shouldStack ? null : arrObj.columns;
 
     return shouldStack;
   },
 
   // ----------
+  // Function: _freezeItemSize
+  // Freezes current item size (when removing a child).
+  //
+  // Parameters:
+  //   itemCount - the number of children before the last one was removed
+  _freezeItemSize: function GroupItem__freezeItemSize(itemCount) {
+    let data = this._frozenItemSizeData;
+
+    if (!data.lastItemCount) {
+      let self = this;
+      data.lastItemCount = itemCount;
+
+      // unfreeze item size when tabview is hidden
+      data.onTabViewHidden = function () self._unfreezeItemSize();
+      window.addEventListener('tabviewhidden', data.onTabViewHidden, false);
+
+      // we don't need to observe mouse movement when expanded because the
+      // tray is closed when we leave it and collapse causes unfreezing
+      if (self.expanded)
+        return;
+
+      // unfreeze item size when cursor is moved out of group bounds
+      data.onMouseMove = function (e) {
+        let cursor = new Point(e.pageX, e.pageY);
+        if (!self.bounds.contains(cursor))
+          self._unfreezeItemSize();
+      }
+      iQ(window).mousemove(data.onMouseMove);
+    }
+
+    this.arrange({animate: true, count: data.lastItemCount});
+  },
+
+  // ----------
+  // Function: _unfreezeItemSize
+  // Unfreezes and updates item size.
+  //
+  // Parameters:
+  //   options - various options (see below)
+  //
+  // Possible options:
+  //   dontArrange - do not arrange items when unfreezing
+  _unfreezeItemSize: function GroupItem__unfreezeItemSize(options) {
+    let data = this._frozenItemSizeData;
+    if (!data.lastItemCount)
+      return;
+
+    if (!options || !options.dontArrange)
+      this.arrange({animate: true});
+
+    // unbind event listeners
+    window.removeEventListener('tabviewhidden', data.onTabViewHidden, false);
+    if (data.onMouseMove)
+      iQ(window).unbind('mousemove', data.onMouseMove);
+
+    // reset freeze status
+    this._frozenItemSizeData = {};
+  },
+
+  // ----------
   // Function: arrange
   // Lays out all of the children.
   //
   // Parameters:
   //   options - passed to <Items.arrange> or <_stackArrange>, except those below
   //
   // Options:
   //   addTab - (boolean) if true, we add one to the child count
@@ -1549,16 +1632,17 @@ GroupItem.prototype = Utils.extend(new I
       this.expanded.$shield.remove();
       this.expanded = null;
 
       this._children.forEach(function(child) {
         child.removeClass("stack-trayed");
       });
 
       this.arrange({z: z + 2});
+      this._unfreezeItemSize({dontArrange: true});
     }
   },
 
   // ----------
   // Function: _addHandlers
   // Helper routine for the constructor; adds various event handlers to the container.
   _addHandlers: function GroupItem__addHandlers(container) {
     let self = this;
@@ -1676,18 +1760,21 @@ GroupItem.prototype = Utils.extend(new I
       self.expand();
     });
   },
 
   // ----------
   // Function: setResizable
   // Sets whether the groupItem is resizable and updates the UI accordingly.
   setResizable: function GroupItem_setResizable(value, immediately) {
+    var self = this;
+
     this.resizeOptions.minWidth = GroupItems.minGroupWidth;
     this.resizeOptions.minHeight = GroupItems.minGroupHeight;
+    this.resizeOptions.start = function () self._unfreezeItemSize();
 
     if (value) {
       immediately ? this.$resizer.show() : this.$resizer.fadeIn();
       this.resizable(true);
     } else {
       immediately ? this.$resizer.hide() : this.$resizer.fadeOut();
       this.resizable(false);
     }
@@ -1788,16 +1875,23 @@ let GroupItems = {
   _arrangesPending: [],
   _removingHiddenGroups: false,
   _delayedModUpdates: [],
   _autoclosePaused: false,
   minGroupHeight: 110,
   minGroupWidth: 125,
 
   // ----------
+  // Function: toString
+  // Prints [GroupItems] for debug use
+  toString: function GroupItems_toString() {
+    return "[GroupItems count=" + this.groupItems.length + "]";
+  },
+
+  // ----------
   // Function: init
   init: function GroupItems_init() {
     let self = this;
 
     // setup attr modified handler, and prepare for its uninit
     function handleAttrModified(xulTab) {
       self._handleAttrModified(xulTab);
     }
--- a/browser/base/content/tabview/iq.js
+++ b/browser/base/content/tabview/iq.js
@@ -181,16 +181,33 @@ function iQClass(selector, context) {
       Utils.merge(ret, selector);
     }
   }
   return ret;
 };
   
 iQClass.prototype = {
 
+  // ----------
+  // Function: toString
+  // Prints [iQ...] for debug use
+  toString: function iQClass_toString() {
+    if (this.length > 1) {
+      if (this.selector)
+        return "[iQ (" + this.selector + ")]";
+      else
+        return "[iQ multi-object]";
+    }
+
+    if (this.length == 1)
+      return "[iQ (" + this[0].toString() + ")]";
+
+    return "[iQ non-object]";
+  },
+
   // Start with an empty selector
   selector: "",
 
   // The default length of a iQ object is 0
   length: 0,
 
   // ----------
   // Function: each
--- a/browser/base/content/tabview/items.js
+++ b/browser/base/content/tabview/items.js
@@ -18,16 +18,17 @@
  * Portions created by the Initial Developer are Copyright (C) 2010
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  * Ian Gilman <ian@iangilman.com>
  * Aza Raskin <aza@mozilla.com>
  * Michael Yoshitaka Erlewine <mitcho@mitcho.com>
  * Sean Dunn <seanedunn@yahoo.com>
+ * Tim Taubert <tim.taubert@gmx.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
@@ -164,18 +165,20 @@ Item.prototype = {
     }
 
     iQ(this.container).data('item', this);
 
     // ___ drag
     this.dragOptions = {
       cancelClass: 'close stackExpander',
       start: function(e, ui) {
-        if (this.isAGroupItem)
+        if (this.isAGroupItem) {
           GroupItems.setActiveGroupItem(this);
+          this._unfreezeItemSize();
+        }
         // if we start dragging a tab within a group, start with dropSpace on.
         else if (this.parent != null)
           this.parent._dropSpaceActive = true;
         drag.info = new Drag(this, e);
       },
       drag: function(e) {
         drag.info.drag(e);
       },
@@ -593,16 +596,45 @@ Item.prototype = {
       var $container = iQ(this.container);
       var startMouse;
       var startPos;
       var startSent;
       var startEvent;
       var droppables;
       var dropTarget;
 
+      // determine the best drop target based on the current mouse coordinates
+      let determineBestDropTarget = function (e, box) {
+        // drop events
+        var best = {
+          dropTarget: null,
+          score: 0
+        };
+
+        droppables.forEach(function(droppable) {
+          var intersection = box.intersection(droppable.bounds);
+          if (intersection && intersection.area() > best.score) {
+            var possibleDropTarget = droppable.item;
+            var accept = true;
+            if (possibleDropTarget != dropTarget) {
+              var dropOptions = possibleDropTarget.dropOptions;
+              if (dropOptions && typeof dropOptions.accept == "function")
+                accept = dropOptions.accept.apply(possibleDropTarget, [self]);
+            }
+
+            if (accept) {
+              best.dropTarget = possibleDropTarget;
+              best.score = intersection.area();
+            }
+          }
+        });
+
+        return best.dropTarget;
+      }
+
       // ___ mousemove
       var handleMouseMove = function(e) {
         // global drag tracking
         drag.lastMoveTime = Date.now();
 
         // positioning
         var mouse = new Point(e.pageX, e.pageY);
         if (!startSent) {
@@ -619,49 +651,27 @@ Item.prototype = {
           var box = self.getBounds();
           box.left = startPos.x + (mouse.x - startMouse.x);
           box.top = startPos.y + (mouse.y - startMouse.y);
           self.setBounds(box, true);
 
           if (typeof self.dragOptions.drag == "function")
             self.dragOptions.drag.apply(self, [e]);
 
-          // drop events
-          var best = {
-            dropTarget: null,
-            score: 0
-          };
+          let bestDropTarget = determineBestDropTarget(e, box);
 
-          droppables.forEach(function(droppable) {
-            var intersection = box.intersection(droppable.bounds);
-            if (intersection && intersection.area() > best.score) {
-              var possibleDropTarget = droppable.item;
-              var accept = true;
-              if (possibleDropTarget != dropTarget) {
-                var dropOptions = possibleDropTarget.dropOptions;
-                if (dropOptions && typeof dropOptions.accept == "function")
-                  accept = dropOptions.accept.apply(possibleDropTarget, [self]);
-              }
-
-              if (accept) {
-                best.dropTarget = possibleDropTarget;
-                best.score = intersection.area();
-              }
-            }
-          });
-
-          if (best.dropTarget != dropTarget) {
+          if (bestDropTarget != dropTarget) {
             var dropOptions;
             if (dropTarget) {
               dropOptions = dropTarget.dropOptions;
               if (dropOptions && typeof dropOptions.out == "function")
                 dropOptions.out.apply(dropTarget, [e]);
             }
 
-            dropTarget = best.dropTarget;
+            dropTarget = bestDropTarget;
 
             if (dropTarget) {
               dropOptions = dropTarget.dropOptions;
               if (dropOptions && typeof dropOptions.over == "function")
                 dropOptions.over.apply(dropTarget, [e]);
             }
           }
           if (dropTarget) {
@@ -705,32 +715,34 @@ Item.prototype = {
         });
 
         if (cancel) {
           e.preventDefault();
           return;
         }
 
         startMouse = new Point(e.pageX, e.pageY);
-        startPos = self.getBounds().position();
+        let bounds = self.getBounds();
+        startPos = bounds.position();
         startEvent = e;
         startSent = false;
-        dropTarget = null;
 
         droppables = [];
         iQ('.iq-droppable').each(function(elem) {
           if (elem != self.container) {
             var item = Items.item(elem);
             droppables.push({
               item: item,
               bounds: item.getBounds()
             });
           }
         });
 
+        dropTarget = determineBestDropTarget(e, bounds);
+
         iQ(gWindow)
           .mousemove(handleMouseMove)
           .mouseup(handleMouseUp);
 
         e.preventDefault();
       });
     } catch(e) {
       Utils.log(e);
@@ -850,16 +862,23 @@ Item.prototype = {
   }
 };
 
 // ##########
 // Class: Items
 // Keeps track of all Items.
 let Items = {
   // ----------
+  // Function: toString
+  // Prints [Items] for debug use
+  toString: function Items_toString() {
+    return "[Items]";
+  },
+
+  // ----------
   // Variable: defaultGutter
   // How far apart Items should be from each other and from bounds
   defaultGutter: 15,
 
   // ----------
   // Function: item
   // Given a DOM element representing an Item, returns the Item.
   item: function Items_item(el) {
--- a/browser/base/content/tabview/modules/AllTabs.jsm
+++ b/browser/base/content/tabview/modules/AllTabs.jsm
@@ -36,16 +36,23 @@
  * ***** END LICENSE BLOCK ***** */
 
 const Cu = Components.utils;
 Cu.import("resource://gre/modules/Services.jsm");
 
 let EXPORTED_SYMBOLS = ["AllTabs"];
 
 let AllTabs = {
+  // ----------
+  // Function: toString
+  // Prints [AllTabs] for debug use
+  toString: function AllTabs_toString() {
+    return "[AllTabs]";
+  },
+
   /**
    * Get an array of all tabs from all tabbrowser windows.
    *
    * @usage let numAllTabs = AllTabs.tabs.length;
    *        AllTabs.tabs.forEach(handleAllTabs);
    */
   get tabs() {
     // Get tabs from each browser window and flatten them into one array
--- a/browser/base/content/tabview/modules/utils.jsm
+++ b/browser/base/content/tabview/modules/utils.jsm
@@ -16,16 +16,17 @@
  * The Initial Developer of the Original Code is the Mozilla Foundation.
  * Portions created by the Initial Developer are Copyright (C) 2010
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  * Aza Raskin <aza@mozilla.com>
  * Ian Gilman <ian@iangilman.com>
  * Michael Yoshitaka Erlewine <mitcho@mitcho.com>
+ * Tim Taubert <tim.taubert@gmx.de>
  *
  * This file incorporates work from:
  * jQuery JavaScript Library v1.4.2: http://code.jquery.com/jquery-1.4.2.js
  * This incorporated work is covered by the following copyright and
  * permission notice:
  * Copyright 2010, John Resig
  * Dual licensed under the MIT or GPL Version 2 licenses.
  * http://jquery.org/license
@@ -70,16 +71,23 @@ function Point(a, y) {
   } else {
     this.x = (Utils.isNumber(a) ? a : 0);
     this.y = (Utils.isNumber(y) ? y : 0);
   }
 };
 
 Point.prototype = {
   // ----------
+  // Function: toString
+  // Prints [Point (x,y)] for debug use
+  toString: function Point_toString() {
+    return "[Point (" + this.x + "," + this.y + ")]";
+  },
+
+  // ----------
   // Function: distance
   // Returns the distance from this point to the given <Point>.
   distance: function Point_distance(point) {
     var ax = this.x - point.x;
     var ay = this.y - point.y;
     return Math.sqrt((ax * ax) + (ay * ay));
   }
 };
@@ -104,16 +112,23 @@ function Rect(a, top, width, height) {
     this.left = a;
     this.top = top;
     this.width = width;
     this.height = height;
   }
 };
 
 Rect.prototype = {
+  // ----------
+  // Function: toString
+  // Prints [Rect (left,top,width,height)] for debug use
+  toString: function Rect_toString() {
+    return "[Rect (" + this.left + "," + this.top + "," +
+            this.width + "," + this.height + ")]";
+  },
 
   get right() this.left + this.width,
   set right(value) {
     this.width = value - this.left;
   },
 
   get bottom() this.top + this.height,
   set bottom(value) {
@@ -151,26 +166,32 @@ Rect.prototype = {
     if (box.width > 0 && box.height > 0)
       return box;
 
     return null;
   },
 
   // ----------
   // Function: contains
-  // Returns a boolean denoting if the given <Rect> is contained within
+  // Returns a boolean denoting if the <Rect> or <Point> is contained inside
   // this rectangle.
   //
-  // Paramaters
-  //  - A <Rect>
-  contains: function Rect_contains(rect) {
-    return (rect.left >= this.left &&
-            rect.right <= this.right &&
-            rect.top >= this.top &&
-            rect.bottom <= this.bottom);
+  // Parameters
+  //  - A <Rect> or a <Point>
+  contains: function Rect_contains(a) {
+    if (Utils.isPoint(a))
+      return (a.x > this.left &&
+              a.x < this.right &&
+              a.y > this.top &&
+              a.y < this.bottom);
+
+    return (a.left >= this.left &&
+            a.right <= this.right &&
+            a.top >= this.top &&
+            a.bottom <= this.bottom);
   },
 
   // ----------
   // Function: center
   // Returns a new <Point> with the center location of this rectangle.
   center: function Rect_center() {
     return new Point(this.left + (this.width / 2), this.top + (this.height / 2));
   },
@@ -277,16 +298,23 @@ function Range(min, max) {
     this.max = min.max;
   } else {
     this.min = min || 0;
     this.max = max || 0;
   }
 };
 
 Range.prototype = {
+  // ----------
+  // Function: toString
+  // Prints [Range (min,max)] for debug use
+  toString: function Range_toString() {
+    return "[Range (" + this.min + "," + this.max + ")]";
+  },
+
   // Variable: extent
   // Equivalent to max-min
   get extent() {
     return (this.max - this.min);
   },
 
   set extent(extent) {
     this.max = extent - this.min;
@@ -459,16 +487,23 @@ Subscribable.prototype = {
 };
 
 // ##########
 // Class: Utils
 // Singelton with common utility functions.
 let Utils = {
   defaultFaviconURL: "chrome://mozapps/skin/places/defaultFavicon.png",
 
+  // ----------
+  // Function: toString
+  // Prints [Utils] for debug use
+  toString: function Utils_toString() {
+    return "[Utils]";
+  },
+
   // ___ Logging
   useConsole: true, // as opposed to dump
   showTime: false,
 
   // ----------
   // Function: log
   // Prints the given arguments to the JavaScript error console as a message.
   // Pass as many arguments as you want, it'll print them all.
--- a/browser/base/content/tabview/search.js
+++ b/browser/base/content/tabview/search.js
@@ -111,16 +111,23 @@ function scorePatternMatch(pattern, matc
 
 // ##########
 // Class: TabUtils
 // 
 // A collection of helper functions for dealing with both
 // <TabItem>s and <xul:tab>s without having to worry which
 // one is which.
 var TabUtils = {
+  // ----------
+  // Function: toString
+  // Prints [TabUtils] for debug use
+  toString: function TabUtils_toString() {
+    return "[TabUtils]";
+  },
+
   // ---------
   // Function: _nameOfTab
   // Given a <TabItem> or a <xul:tab> returns the tab's name.
   nameOf: function TabUtils_nameOfTab(tab) {
     // We can have two types of tabs: A <TabItem> or a <xul:tab>
     // because we have to deal with both tabs represented inside
     // of active Panoramas as well as for windows in which
     // Panorama has yet to be activated. We uses object sniffing to
@@ -161,17 +168,24 @@ var TabUtils = {
 // 
 // A singleton class that allows you to iterate over
 // matching and not-matching tabs, given a case-insensitive
 // search term.
 function TabMatcher(term) { 
   this.term = term; 
 }
 
-TabMatcher.prototype = {  
+TabMatcher.prototype = {
+  // ----------
+  // Function: toString
+  // Prints [TabMatcher (term)] for debug use
+  toString: function TabMatcher_toString() {
+    return "[TabMatcher (" + this.term + ")]";
+  },
+
   // ---------
   // Function: _filterAndSortMatches
   // Given an array of <TabItem>s and <xul:tab>s returns a new array
   // of tabs whose name matched the search term, sorted by lexical
   // closeness.  
   _filterAndSortForMatches: function TabMatcher__filterAndSortForMatches(tabs) {
     var self = this;
     tabs = tabs.filter(function(tab){
@@ -312,16 +326,23 @@ TabMatcher.prototype = {
 // A singleton class that handles all of the
 // event handlers.
 function SearchEventHandlerClass() { 
   this.init(); 
 }
 
 SearchEventHandlerClass.prototype = {
   // ----------
+  // Function: toString
+  // Prints [SearchEventHandler] for debug use
+  toString: function SearchEventHandlerClass_toString() {
+    return "[SearchEventHandler]";
+  },
+
+  // ----------
   // Function: init
   // Initializes the searchbox to be focused, and everything
   // else to be hidden, and to have everything have the appropriate
   // event handlers;
   init: function () {
     var self = this;
     iQ("#searchbox")[0].focus(); 
     iQ("#search").hide();
--- a/browser/base/content/tabview/storage.js
+++ b/browser/base/content/tabview/storage.js
@@ -46,16 +46,23 @@ let Storage = {
   GROUP_DATA_IDENTIFIER: "tabview-group",
   GROUPS_DATA_IDENTIFIER: "tabview-groups",
   TAB_DATA_IDENTIFIER: "tabview-tab",
   UI_DATA_IDENTIFIER: "tabview-ui",
   CACHE_CLIENT_IDENTIFIER: "tabview-cache",
   CACHE_PREFIX: "moz-panorama:",
 
   // ----------
+  // Function: toString
+  // Prints [Storage] for debug use
+  toString: function Storage_toString() {
+    return "[Storage]";
+  },
+
+  // ----------
   // Function: init
   // Sets up the object.
   init: function Storage_init() {
     this._sessionStore =
       Cc["@mozilla.org/browser/sessionstore;1"].
         getService(Ci.nsISessionStore);
     
     // Create stream-based cache session for tabview
@@ -408,13 +415,20 @@ let Storage = {
 // Calls <callback>(entry, access, status) when the requested cache entry
 // is available.
 function CacheListener(callback) {
   Utils.assert(typeof callback == "function", "callback arg must be a function");
   this.callback = callback;
 };
 
 CacheListener.prototype = {
+  // ----------
+  // Function: toString
+  // Prints [CacheListener] for debug use
+  toString: function CacheListener_toString() {
+    return "[CacheListener]";
+  },
+
   QueryInterface: XPCOMUtils.generateQI([Ci.nsICacheListener]),
   onCacheEntryAvailable: function (entry, access, status) {
     this.callback(entry, access, status);
   }
 };
--- a/browser/base/content/tabview/tabitems.js
+++ b/browser/base/content/tabview/tabitems.js
@@ -208,16 +208,23 @@ function TabItem(tab, options) {
 
   // ___ reconnect to data from Storage
   if (!TabItems.reconnectingPaused())
     this._reconnect();
 };
 
 TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
   // ----------
+  // Function: toString
+  // Prints [TabItem (tab)] for debug use
+  toString: function TabItem_toString() {
+    return "[TabItem (" + this.tab + ")]";
+  },
+
+  // ----------
   // Function: forceCanvasSize
   // Repaints the thumbnail with the given resolution, and forces it
   // to stay that resolution until unforceCanvasSize is called.
   forceCanvasSize: function TabItem_forceCanvasSize(w, h) {
     this.canvasSizeForced = true;
     this.$canvas[0].width = w;
     this.$canvas[0].height = h;
     this.tabCanvas.paint();
@@ -667,16 +674,18 @@ TabItem.prototype = Utils.extend(new Ite
         self.parent.collapse();
     }
 
     let animateZoom = gPrefBranch.getBoolPref("animate_zoom");
     if (animateZoom) {
       let transform = this.getZoomTransform();
       TabItems.pausePainting();
 
+      if (this.parent && this.parent.expanded)
+        $tabEl.removeClass("stack-trayed");
       $tabEl.addClass("front");
       $canvas
         .css({ '-moz-transform-origin': transform.transformOrigin })
         .animate({ '-moz-transform': transform.transform }, {
           duration: 230,
           easing: 'fast',
           complete: function() {
             onZoomDone();
@@ -707,16 +716,17 @@ TabItem.prototype = Utils.extend(new Ite
       $canvas.css("-moz-transform", null);
 
       GroupItems.setActiveOrphanTab(null);
 
       if (typeof complete == "function")
         complete();
     };
 
+    UI.setActiveTab(this);
     TabItems._update(this.tab, {force: true});
 
     $tab.addClass("front");
 
     // If we're in a stacked group, make sure we become the
     // topChild now so that we show the zoom animation correctly.
     if (this.parent && this.parent.isStacked())
       this.parent.setTopChild(this);
@@ -808,16 +818,23 @@ let TabItems = {
   _eventListeners: [],
   _pauseUpdateForTest: false,
   creatingNewOrphanTab: false,
   tempCanvas: null,
   _reconnectingPaused: false,
   tabItemPadding: {},
 
   // ----------
+  // Function: toString
+  // Prints [TabItems count=count] for debug use
+  toString: function TabItems_toString() {
+    return "[TabItems count=" + this.items.length + "]";
+  },
+
+  // ----------
   // Function: init
   // Set up the necessary tracking to maintain the <TabItems>s.
   init: function TabItems_init() {
     Utils.assert(window.AllTabs, "AllTabs must be initialized first");
     let self = this;
     
     // Set up tab priority queue
     this._tabsWaitingForUpdate = new TabPriorityQueue();
@@ -850,17 +867,19 @@ let TabItems = {
 
       self.update(tab);
     }
     // When a tab is closed, unlink.
     this._eventListeners["close"] = function(tab) {
       if (tab.ownerDocument.defaultView != gWindow || tab.pinned)
         return;
 
-      self.unlink(tab);
+      // XXX bug #635975 - don't unlink the tab if the dom window is closing.
+      if (!UI.isDOMWindowClosing)
+        self.unlink(tab);
     }
     for (let name in this._eventListeners) {
       AllTabs.register(name, this._eventListeners[name]);
     }
 
     // For each tab, create the link.
     AllTabs.tabs.forEach(function(tab) {
       if (tab.ownerDocument.defaultView != gWindow || tab.pinned)
@@ -1334,16 +1353,23 @@ let TabItems = {
 function TabPriorityQueue() {
 };
 
 TabPriorityQueue.prototype = {
   _low: [], // low priority queue
   _high: [], // high priority queue
 
   // ----------
+  // Function: toString
+  // Prints [TabPriorityQueue count=count] for debug use
+  toString: function TabPriorityQueue_toString() {
+    return "[TabPriorityQueue count=" + (this._low.length + this._high.length) + "]";
+  },
+
+  // ----------
   // Function: clear
   // Empty the update queue
   clear: function TabPriorityQueue_clear() {
     this._low = [];
     this._high = [];
   },
 
   // ----------
@@ -1435,16 +1461,23 @@ TabPriorityQueue.prototype = {
 // Does not need to be accessed from outside of tabitems.js
 function TabCanvas(tab, canvas) {
   this.tab = tab;
   this.canvas = canvas;
 };
 
 TabCanvas.prototype = {
   // ----------
+  // Function: toString
+  // Prints [TabCanvas (tab)] for debug use
+  toString: function TabCanvas_toString() {
+    return "[TabCanvas (" + this.tab + ")]";
+  },
+
+  // ----------
   // Function: paint
   paint: function TabCanvas_paint(evt) {
     var w = this.canvas.width;
     var h = this.canvas.height;
     if (!w || !h)
       return;
 
     if (!this.tab.linkedBrowser.contentWindow) {
--- a/browser/base/content/tabview/tabview.css
+++ b/browser/base/content/tabview/tabview.css
@@ -107,21 +107,16 @@ body {
 
 /* Other Items
 ----------------------------------*/
 
 .undo {
   position: absolute;
 }
 
-.undo .close {
-  display: inline-block;
-  position: relative;
-}
-
 .info-item {
   position: absolute;
 }
 
 /* Trenches
 ----------------------------------*/
 
 .guideTrench, 
--- a/browser/base/content/tabview/trench.js
+++ b/browser/base/content/tabview/trench.js
@@ -105,16 +105,25 @@ function Trench(element, xory, type, edg
   //   minRange - (<Range>) the minimum active range
   //   activeRange - (<Range>) the currently active range
   this.range = new Range(0,10000);
   this.minRange = new Range(0,0);
   this.activeRange = new Range(0,10000);
 };
 
 Trench.prototype = {
+  // ----------
+  // Function: toString
+  // Prints [Trench edge type (parentItem)] for debug use
+  toString: function Trench_toString() {
+    return "[Trench " + this.edge + " " + this.type +
+           (this.parentItem ? " (" + this.parentItem + ")" : "") +
+           "]";
+  },
+
   //----------
   // Variable: radius
   // (integer) radius is how far away we should snap from
   get radius() this.customRadius || Trenches.defaultRadius,
 
   setParentItem: function Trench_setParentItem(item) {
     if (!item.isAnItem) {
       Utils.assert(false, "parentItem must be an Item");
@@ -476,16 +485,23 @@ var Trenches = {
   // Variables: snapping preferences; used to break ties in snapping.
   //   preferTop - (boolean) prefer snapping to the top to the bottom
   //   preferLeft - (boolean) prefer snapping to the left to the right
   preferTop: true,
   get preferLeft() { return !UI.rtl; },
 
   trenches: [],
 
+  // ----------
+  // Function: toString
+  // Prints [Trenches count=count] for debug use
+  toString: function Trenches_toString() {
+    return "[Trenches count=" + this.trenches.length + "]";
+  },
+
   // ---------
   // Function: getById
   // Return the specified <Trench>.
   //
   // Parameters:
   //   id - (integer)
   getById: function Trenches_getById(id) {
     return this.trenches[id];
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -128,16 +128,23 @@ let UI = {
   _storageBusyCount: 0,
 
   // Variable: isDOMWindowClosing
   // Tells wether we already received the "domwindowclosed" event and the parent
   // windows is about to close.
   isDOMWindowClosing: false,
 
   // ----------
+  // Function: toString
+  // Prints [UI] for debug use
+  toString: function UI_toString() {
+    return "[UI]";
+  },
+
+  // ----------
   // Function: init
   // Must be called after the object is created.
   init: function UI_init() {
     try {
       let self = this;
 
       // initialize the direction of the page
       this._initPageDirection();
--- a/browser/base/content/test/browser_utilityOverlay.js
+++ b/browser/base/content/test/browser_utilityOverlay.js
@@ -1,15 +1,15 @@
 var gTestTab;
 
 function test() {
   waitForExplicitFinish();
 
   is(getTopWin(), window, "got top window");
-  is(getBoolPref("general.startup.browser", false), true, "getBoolPref");
+  is(getBoolPref("browser.search.openintab", false), false, "getBoolPref");
   is(getBoolPref("this.pref.doesnt.exist", true), true, "getBoolPref fallback");
   is(getBoolPref("this.pref.doesnt.exist", false), false, "getBoolPref fallback #2");
 
 
   gTestTab = openNewTabWith("http://example.com");
   gBrowser.selectedTab = gTestTab;
   gTestTab.linkedBrowser.addEventListener("load", function () {
     gTestTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
--- a/browser/base/content/test/tabview/Makefile.in
+++ b/browser/base/content/test/tabview/Makefile.in
@@ -80,16 +80,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug604098.js \
                  browser_tabview_bug604699.js \
                  browser_tabview_bug606657.js \
                  browser_tabview_bug606905.js \
                  browser_tabview_bug608037.js \
                  browser_tabview_bug608184.js \
                  browser_tabview_bug608158.js \
                  browser_tabview_bug608405.js \
+                 browser_tabview_bug610208.js \
                  browser_tabview_bug610242.js \
                  browser_tabview_bug612470.js \
                  browser_tabview_bug613541.js \
                  browser_tabview_bug616729.js \
                  browser_tabview_bug616967.js \
                  browser_tabview_bug618816.js \
                  browser_tabview_bug618828.js \
                  browser_tabview_bug619937.js \
@@ -118,16 +119,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug633788.js \
                  browser_tabview_bug634077.js \
                  browser_tabview_bug634085.js \
                  browser_tabview_bug634158.js \
                  browser_tabview_bug635696.js \
                  browser_tabview_dragdrop.js \
                  browser_tabview_exit_button.js \
                  browser_tabview_expander.js \
+                 browser_tabview_firstrun_pref.js \
                  browser_tabview_group.js \
                  browser_tabview_launch.js \
                  browser_tabview_multiwindow_search.js \
                  browser_tabview_orphaned_tabs.js \
                  browser_tabview_privatebrowsing.js \
                  browser_tabview_rtl.js \
                  browser_tabview_search.js \
                  browser_tabview_snapping.js \
--- a/browser/base/content/test/tabview/browser_tabview_bug597980.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug597980.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function test() {
   waitForExplicitFinish();
 
-  newWindowWithTabView(onTabViewShown);
+  newWindowWithTabView(part1);
 }
 
-function onTabViewShown(win) {
+function part1(win) {
+  registerCleanupFunction(function() win.close());
+
   let contentWindow = win.document.getElementById("tab-view").contentWindow;
   is(contentWindow.GroupItems.groupItems.length, 1, "Has only one group");
 
   let originalTab = win.gBrowser.selectedTab;
   let originalGroup = contentWindow.GroupItems.groupItems[0];
   let newTab = win.gBrowser.loadOneTab("about:blank", {inBackground: true});
   
   is(originalGroup.getChildren().length, 2, "The original group now has two tabs");
@@ -47,13 +49,37 @@ function onTabViewShown(win) {
   EventUtils.sendMouseEvent({ type: "mousedown" },
                             newTab._tabViewTabItem.container, contentWindow);
   EventUtils.sendMouseEvent({ type: "mouseup" },
                             newTab._tabViewTabItem.container, contentWindow);
   setTimeout(function() {
     checkActive(function() {
       checkActive(function() {
         win.close();
-        finish();
+        newWindowWithTabView(part2);
       });
     }, 490);
   }, 10)
 }
+
+function part2(win) {
+  registerCleanupFunction(function() win.close());
+
+  let newTab = win.gBrowser.loadOneTab("about:blank", {inBackground: true});
+  hideTabView(function() {
+    let selectedTab = win.gBrowser.selectedTab;
+    isnot(selectedTab, newTab, "They are different tabs");
+
+    // switch the selected tab to new tab
+    win.gBrowser.selectedTab = newTab;
+
+    win.addEventListener("tabviewhidden", function () {
+      win.removeEventListener("tabviewhidden", arguments.callee, false);
+      is(win.gBrowser.selectedTab, newTab, "The seleted tab should be the same as before (new tab)");
+       win.close();
+       finish();
+    }, false);
+    // show tabview
+    EventUtils.synthesizeKey("e", { accelKey: true, shiftKey: true }, win);
+    // hide tabview
+    EventUtils.synthesizeKey("e", { accelKey: true, shiftKey: true }, win);
+  })
+}
--- a/browser/base/content/test/tabview/browser_tabview_bug599626.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug599626.js
@@ -1,12 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 let handleDialog;
+let timer; // keep in outer scope so it's not GC'd before firing
 
 function test() {
   waitForExplicitFinish();
 
   window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
   TabView.toggle();
 }
 
@@ -119,17 +120,17 @@ let observer = {
   }
 };
 
 function startCallbackTimer() {
    // Delay before the callback twiddles the prompt.
    const dialogDelay = 10;
 
    // Use a timer to invoke a callback to twiddle the authentication dialog
-   let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
+   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
    timer.init(observer, dialogDelay, Ci.nsITimer.TYPE_ONE_SHOT);
 }
 
 function getDialogDoc() {
   // Find the <browser> which contains notifyWindow, by looking
   // through all the open windows and all the <browsers> in each.
   let wm = Cc["@mozilla.org/appshell/window-mediator;1"].
             getService(Ci.nsIWindowMediator);
--- a/browser/base/content/test/tabview/browser_tabview_bug600812.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug600812.js
@@ -10,18 +10,18 @@ function test() {
 
     cw.GroupItems.setActiveGroupItem(groupItem);
     gBrowser.loadOneTab('about:blank', {inBackground: true});
 
     return groupItem;
   }
 
   let testVeryQuickDragAndDrop = function () {
-    let sourceGroup = cw.GroupItems.groupItems[0];
-    let targetGroup = createGroupItem();
+    let sourceGroup = createGroupItem();
+    let targetGroup = cw.GroupItems.groupItems[0];
 
     sourceGroup.pushAway(true);
     targetGroup.pushAway(true);
 
     let sourceTab = sourceGroup.getChild(0).container;
     EventUtils.synthesizeMouseAtCenter(sourceTab, {type: 'mousedown'}, cw);
 
     let targetTab = targetGroup.getChild(0).container;
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug610208.js
@@ -0,0 +1,231 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  let cw;
+  let win;
+  let groupItem;
+
+  let next = function () {
+    let test = tests.shift();
+
+    if (test) {
+      test();
+      return;
+    }
+
+    win.close();
+    finish();
+  }
+
+  let prepareTest = function (testName) {
+    let originalBounds = groupItem.getChild(0).getBounds();
+
+    let tabItem = groupItem.getChild(1);
+    let bounds = tabItem.getBounds();
+    tabItem.close();
+
+    ok(originalBounds.equals(groupItem.getChild(0).getBounds()), testName + ': tabs did not change their size');
+    ok(bounds.equals(groupItem.getChild(1).getBounds()), testName + ': third tab is now on second tab\'s previous position');
+    
+    return originalBounds;
+  }
+
+  let cleanUpTest = function (testName, originalBounds, callback) {
+    // Use setTimeout here because the groupItem.arrange() call uses
+    // animation to re-arrange the tabItems.
+    win.setTimeout(function () {
+      ok(!originalBounds.equals(groupItem.getChild(0).getBounds()), testName + ': tabs changed their size');
+
+      // cleanup
+      cw.GroupItems.setActiveGroupItem(groupItem);
+      win.gBrowser.loadOneTab('about:blank', {inBackground: true});
+      afterAllTabsLoaded(callback, win);
+    }, 500);
+  }
+
+  let tests = [];
+
+  // focus group title's input field to cause item arrange
+  let testFocusTitle = function () {
+    let originalBounds = prepareTest('testFocusTitle');
+
+    let target = groupItem.$titleShield[0];
+    EventUtils.synthesizeMouseAtCenter(target, {}, cw);
+
+    cleanUpTest('testFocusTitle', originalBounds, next);
+  }
+
+  // hide tabview to cause item arrange
+  let testHideTabView = function () {
+    let originalBounds = prepareTest('testHideTabView');
+
+    hideTabView(function () {
+      cleanUpTest('testHideTabView', originalBounds, function () {
+        showTabView(next, win);
+      });
+    }, win);
+  }
+
+  // (undo) close a group to cause item arrange
+  let testCloseGroupUndo = function () {
+    let originalBounds = prepareTest('testCloseGroupUndo');
+
+    hideGroupItem(groupItem, function () {
+      unhideGroupItem(groupItem, function () {
+        cleanUpTest('testCloseGroupUndo', originalBounds, next);
+      });
+    });
+  }
+
+  // leave the group's container with the mouse to cause item arrange
+  let testMouseOut = function () {
+    let originalBounds = prepareTest('testMouseOut');
+    let doc = cw.document.documentElement;
+    let bounds = groupItem.getBounds();
+
+    EventUtils.synthesizeMouse(doc, bounds.right - 5, bounds.bottom - 5, {type: 'mousemove'}, cw);
+    ok(originalBounds.equals(groupItem.getChild(0).getBounds()), 'testMouseOut: tabs did not change their size');
+
+    EventUtils.synthesizeMouse(doc, bounds.right + 1, bounds.bottom + 1, {type: 'mousemove'}, cw);
+    cleanUpTest('testMouseOut', originalBounds, next);
+  }
+
+  // sort item (drag it around) in its group to cause item arrange
+  let testSortInGroup = function () {
+    let originalBounds = prepareTest('testSortInGroup');
+    let target = groupItem.getChild(0).container;
+
+    // simulate drag/drop sorting
+    EventUtils.synthesizeMouse(target, 20, 20, {type: 'mousedown'}, cw);
+    EventUtils.synthesizeMouse(target, 40, 20, {type: 'mousemove'}, cw);
+    EventUtils.synthesizeMouse(target, 20, 20, {type: 'mouseup'}, cw);
+
+    cleanUpTest('testSortInGroup', originalBounds, next);
+  }
+
+  // arrange items when the containing group is resized
+  let testResizeGroup = function () {
+    let originalBounds = prepareTest('testResizeGroup');
+    let oldBounds = groupItem.getBounds();
+    let resizer = groupItem.$resizer[0];
+
+    // simulate drag/drop resizing
+    EventUtils.synthesizeMouse(resizer, 5, 5, {type: 'mousedown'}, cw);
+    EventUtils.synthesizeMouse(resizer, 40, 20, {type: 'mousemove'}, cw);
+    EventUtils.synthesizeMouse(resizer, 20, 20, {type: 'mouseup'}, cw);
+
+    // reset group size
+    groupItem.setBounds(oldBounds);
+    groupItem.setUserSize();
+
+    cleanUpTest('testResizeGroup', originalBounds, next);
+  }
+
+  // make sure we don't freeze item size when removing an item from a stack
+  let testRemoveWhileStacked = function () {
+    let oldBounds = groupItem.getBounds();
+    groupItem.setSize(150, 200, true);
+    groupItem.setUserSize();
+
+    let originalBounds = groupItem.getChild(0).getBounds();
+    ok(!groupItem._isStacked, 'testRemoveWhileStacked: group is not stacked');
+
+    // add a new tab to let the group stack
+    win.gBrowser.loadOneTab('about:blank', {inBackground: true});
+    ok(groupItem._isStacked, 'testRemoveWhileStacked: group is now stacked');
+
+    afterAllTabsLoaded(function () {
+      groupItem.getChild(0).close();
+      let bounds = groupItem.getChild(0).getBounds();
+      ok(originalBounds.equals(bounds), 'testRemoveWhileStacked: tabs did not change their size');
+
+      // reset group size
+      groupItem.setBounds(oldBounds);
+      groupItem.setUserSize();
+
+      next();
+    }, win);
+  }
+
+  // 1) make sure item size is frozen when removing an item in expanded mode
+  // 2) make sure item size stays frozen while moving the mouse in the expanded
+  // layer
+  let testExpandedMode = function () {
+    let oldBounds = groupItem.getBounds();
+    groupItem.setSize(100, 100, true);
+    groupItem.setUserSize();
+
+    ok(groupItem._isStacked, 'testExpandedMode: group is stacked');
+
+    groupItem.addSubscriber(groupItem, 'expanded', function () {
+      groupItem.removeSubscriber(groupItem, 'expanded');
+      onExpanded();
+    });
+
+    groupItem.addSubscriber(groupItem, 'collapsed', function () {
+      groupItem.removeSubscriber(groupItem, 'collapsed');
+      onCollapsed();
+    });
+
+    let onExpanded = function () {
+      let originalBounds = groupItem.getChild(0).getBounds();
+      let tabItem = groupItem.getChild(1);
+      let bounds = tabItem.getBounds();
+
+      for (let i=0; i<3; i++)
+        groupItem.getChild(1).close();
+
+      ok(originalBounds.equals(groupItem.getChild(0).getBounds()), 'testExpandedMode: tabs did not change their size');
+
+      // move the mouse over the expanded layer
+      let trayBounds = groupItem.expanded.bounds;
+      let target = groupItem.expanded.$tray[0];
+      EventUtils.synthesizeMouse(target, trayBounds.right - 5, trayBounds.bottom -5, {type: 'mousemove'}, cw);
+
+      ok(originalBounds.equals(groupItem.getChild(0).getBounds()), 'testExpandedMode: tabs did not change their size');
+      groupItem.collapse();
+    }
+
+    let onCollapsed = function () {
+      // reset group size
+      groupItem.setBounds(oldBounds);
+      groupItem.setUserSize();
+
+      next();
+    }
+
+    groupItem.expand();
+  }
+
+  tests.push(testFocusTitle);
+  tests.push(testHideTabView);
+  tests.push(testCloseGroupUndo);
+  tests.push(testMouseOut);
+  tests.push(testSortInGroup);
+  tests.push(testResizeGroup);
+  tests.push(testRemoveWhileStacked);
+  tests.push(testExpandedMode);
+
+  waitForExplicitFinish();
+
+  newWindowWithTabView(function (tvwin) {
+    win = tvwin;
+
+    registerCleanupFunction(function () {
+      if (!win.closed)
+        win.close();
+    });
+
+    cw = win.TabView.getContentWindow();
+
+    groupItem = cw.GroupItems.groupItems[0];
+    groupItem.setSize(400, 200, true);
+    groupItem.setUserSize();
+
+    for (let i=0; i<3; i++)
+      win.gBrowser.loadOneTab('about:blank', {inBackground: true});
+
+    afterAllTabsLoaded(next, win);
+  });
+}
--- a/browser/base/content/test/tabview/browser_tabview_firstrun_pref.js
+++ b/browser/base/content/test/tabview/browser_tabview_firstrun_pref.js
@@ -1,52 +1,55 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var prefsBranch = Cc["@mozilla.org/preferences-service;1"].
+let prefsBranch = Cc["@mozilla.org/preferences-service;1"].
                   getService(Ci.nsIPrefService).
                   getBranch("browser.panorama.");
+let originalPrefState;
 
 function test() {
   waitForExplicitFinish();
 
   ok(!TabView.isVisible(), "Main window TabView is hidden");
 
-  ok(experienced(), "should start as experienced");
+  originalPrefState = experienced();
 
   prefsBranch.setBoolPref("experienced_first_run", false);
   ok(!experienced(), "set to not experienced");
 
-  newWindowWithTabView(checkFirstRun, part2);
+  newWindowWithTabView(checkFirstRun, function() {
+    // open tabview doesn't count as first use experience so setting it manually
+    prefsBranch.setBoolPref("experienced_first_run", true);
+    ok(experienced(), "we're now experienced");
+
+    newWindowWithTabView(checkNotFirstRun, endGame);
+  });
 }
 
 function experienced() {
   return prefsBranch.prefHasUserValue("experienced_first_run") &&
     prefsBranch.getBoolPref("experienced_first_run");
 }
 
 function checkFirstRun(win) {
   let contentWindow = win.document.getElementById("tab-view").contentWindow;
   
   // Welcome tab disabled by bug 626754. To be fixed via bug 626926.
-  todo_is(win.gBrowser.tabs.length, 2, "There should be two tabs");
+  is(win.gBrowser.tabs.length, 1, "There should be one tab");
   
   let groupItems = contentWindow.GroupItems.groupItems;
   is(groupItems.length, 1, "There should be one group");
   is(groupItems[0].getChildren().length, 1, "...with one child");
 
   let orphanTabCount = contentWindow.GroupItems.getOrphanedTabs().length;
   // Welcome tab disabled by bug 626754. To be fixed via bug 626926.
-  todo_is(orphanTabCount, 1, "There should also be an orphaned tab");
-  
-  ok(experienced(), "we're now experienced");
-}
+  is(orphanTabCount, 0, "There should also be no orphaned tabs");
 
-function part2() {
-  newWindowWithTabView(checkNotFirstRun, endGame);
+  ok(!experienced(), "we're not experienced");
 }
 
 function checkNotFirstRun(win) {
   let contentWindow = win.document.getElementById("tab-view").contentWindow;
   
   is(win.gBrowser.tabs.length, 1, "There should be one tab");
   
   let groupItems = contentWindow.GroupItems.groupItems;
@@ -55,16 +58,19 @@ function checkNotFirstRun(win) {
 
   let orphanTabCount = contentWindow.GroupItems.getOrphanedTabs().length;
   is(orphanTabCount, 0, "There should also be no orphaned tabs");
 }
 
 function endGame() {
   ok(!TabView.isVisible(), "Main window TabView is still hidden");
   ok(experienced(), "should finish as experienced");
+
+  prefsBranch.setBoolPref("experienced_first_run", originalPrefState);
+
   finish();
 }
 
 function newWindowWithTabView(callback, completeCallback) {
   let charsetArg = "charset=" + window.content.document.characterSet;
   let win = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no,height=800,width=800",
                               "about:blank", charsetArg, null, null, true);
   let onLoad = function() {
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1138,29 +1138,30 @@
               break;
           }
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="mouseover"><![CDATA[
-        if (this.getAttribute("active") != "true" &&
-            this.getAttribute("disabled") != "true") {
+        if (this.getAttribute("active") != "true") {
           this.setAttribute("active", "true");
 
           let event = document.createEvent("Events");
           event.initEvent("DOMMenuItemActive", true, false);
           this.dispatchEvent(event);
 
-          let self = this;
-          setTimeout(function () {
-            if (self.getAttribute("active") == "true")
-              self.menu.open = true;
-          }, this._menuDelay);
+          if (this.getAttribute("disabled") != "true") {
+            let self = this;
+            setTimeout(function () {
+              if (self.getAttribute("active") == "true")
+                self.menu.open = true;
+            }, this._menuDelay);
+          }
         }
       ]]></handler>
 
       <handler event="popupshowing"><![CDATA[
         if (event.target == this.firstChild &&
             this._parentMenupopup._currentPopup)
           this._parentMenupopup._currentPopup.hidePopup();
       ]]></handler>
--- a/browser/branding/nightly/pref/firefox-branding.js
+++ b/browser/branding/nightly/pref/firefox-branding.js
@@ -1,11 +1,10 @@
 pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/");
 pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/");
-pref("browser.panorama.welcome_url", "http://www.mozilla.com/firefox/panorama/");
 // The time interval between checks for a new version (in seconds)
 // nightly=8 hours, official=24 hours
 pref("app.update.interval", 28800);
 // The time interval between the downloading of mar file chunks in the
 // background (in seconds)
 pref("app.update.download.backgroundInterval", 60);
 // URL user can browse to manually if for some reason all update installation
 // attempts fail.
--- a/browser/branding/unofficial/pref/firefox-branding.js
+++ b/browser/branding/unofficial/pref/firefox-branding.js
@@ -1,11 +1,10 @@
 pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/");
 pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/");
-pref("browser.panorama.welcome_url", "http://www.mozilla.com/firefox/panorama/");
 // The time interval between checks for a new version (in seconds)
 // nightly=8 hours, official=24 hours
 pref("app.update.interval", 28800);
 // The time interval between the downloading of mar file chunks in the
 // background (in seconds)
 pref("app.update.download.backgroundInterval", 60);
 // URL user can browse to manually if for some reason all update installation
 // attempts fail.
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -76,16 +76,19 @@ distclean::
 	@$(MAKE) -C browser/installer distclean
 
 source-package::
 	@$(MAKE) -C browser/installer source-package
 
 upload::
 	@$(MAKE) -C browser/installer upload
 
+l10n-check::
+	@$(MAKE) -C browser/locales l10n-check
+
 ifdef ENABLE_TESTS
 # Implemented in testing/testsuite-targets.mk
 
 mochitest-browser-chrome:
 	$(RUN_MOCHITEST) --browser-chrome
 	$(CHECK_TEST_ERROR)
 
 mochitest:: mochitest-browser-chrome
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -47,19 +47,17 @@
 #include "nsMacShellService.h"
 #elif defined(MOZ_WIDGET_GTK2)
 #include "nsGNOMEShellService.h"
 #endif
 
 #ifndef WINCE
 
 #include "nsProfileMigrator.h"
-#if !defined(XP_BEOS)
 #include "nsDogbertProfileMigrator.h"
-#endif
 #if !defined(XP_OS2)
 #include "nsOperaProfileMigrator.h"
 #endif
 #include "nsPhoenixProfileMigrator.h"
 #include "nsSeamonkeyProfileMigrator.h"
 #if defined(XP_WIN) && !defined(__MINGW32__)
 #include "nsIEProfileMigrator.h"
 #elif defined(XP_MACOSX)
@@ -90,19 +88,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindows
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
 #elif defined(MOZ_WIDGET_GTK2)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
 
 #ifndef WINCE
 
-#if !defined(XP_BEOS)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator)
-#endif
 #if !defined(XP_OS2)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator)
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPhoenixProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSeamonkeyProfileMigrator)
 #if defined(XP_WIN) && !defined(__MINGW32__)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEProfileMigrator)
@@ -138,19 +134,17 @@ NS_DEFINE_NAMED_CID(NS_SAFARIPROFILEMIGR
 NS_DEFINE_NAMED_CID(NS_MACIEPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_OMNIWEBPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_CAMINOPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_ICABPROFILEMIGRATOR_CID);
 #endif
 #if !defined(XP_OS2)
 NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID);
 #endif
-#if !defined(XP_BEOS)
 NS_DEFINE_NAMED_CID(NS_DOGBERTPROFILEMIGRATOR_CID);
-#endif
 NS_DEFINE_NAMED_CID(NS_PHOENIXPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID);
 #endif /* WINCE */
 NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
 
 static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
     { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, NULL, DirectoryProviderConstructor },
 #if defined(XP_WIN)
@@ -170,19 +164,17 @@ static const mozilla::Module::CIDEntry k
     { &kNS_MACIEPROFILEMIGRATOR_CID, false, NULL, nsMacIEProfileMigratorConstructor },
     { &kNS_OMNIWEBPROFILEMIGRATOR_CID, false, NULL, nsOmniWebProfileMigratorConstructor },
     { &kNS_CAMINOPROFILEMIGRATOR_CID, false, NULL, nsCaminoProfileMigratorConstructor },
     { &kNS_ICABPROFILEMIGRATOR_CID, false, NULL, nsICabProfileMigratorConstructor },
 #endif
 #if !defined(XP_OS2)
     { &kNS_OPERAPROFILEMIGRATOR_CID, false, NULL, nsOperaProfileMigratorConstructor },
 #endif
-#if !defined(XP_BEOS)
     { &kNS_DOGBERTPROFILEMIGRATOR_CID, false, NULL, nsDogbertProfileMigratorConstructor },
-#endif
     { &kNS_PHOENIXPROFILEMIGRATOR_CID, false, NULL, nsPhoenixProfileMigratorConstructor },
     { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
 #endif /* WINCE */
     { &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
     { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
@@ -216,19 +208,17 @@ static const mozilla::Module::ContractID
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "macie", &kNS_MACIEPROFILEMIGRATOR_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "omniweb", &kNS_OMNIWEBPROFILEMIGRATOR_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "camino", &kNS_CAMINOPROFILEMIGRATOR_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "icab", &kNS_ICABPROFILEMIGRATOR_CID },
 #endif
 #if !defined(XP_OS2)
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "opera", &kNS_OPERAPROFILEMIGRATOR_CID },
 #endif
-#if !defined(XP_BEOS)
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "dogbert", &kNS_DOGBERTPROFILEMIGRATOR_CID },
-#endif
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "phoenix", &kNS_PHOENIXPROFILEMIGRATOR_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
 #endif /* WINCE */
     { NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
     { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kBrowserCategories[] = {
--- a/browser/components/migration/src/Makefile.in
+++ b/browser/components/migration/src/Makefile.in
@@ -50,22 +50,19 @@ USE_STATIC_LIBS = 1
 endif
 
 
 CPPSRCS  = nsProfileMigrator.cpp \
            nsBrowserProfileMigratorUtils.cpp \
            nsNetscapeProfileMigratorBase.cpp \
            nsSeamonkeyProfileMigrator.cpp \
            nsPhoenixProfileMigrator.cpp \
+           nsDogbertProfileMigrator.cpp \
            $(NULL)
 
-ifneq ($(OS_ARCH),BeOS)
-CPPSRCS += nsDogbertProfileMigrator.cpp
-endif
-
 ifneq ($(OS_ARCH),OS2)
 CPPSRCS += nsOperaProfileMigrator.cpp
 endif
 
 ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
 CPPSRCS += nsIEProfileMigrator.cpp \
            $(NULL)
 endif
--- a/browser/components/migration/src/nsOperaProfileMigrator.cpp
+++ b/browser/components/migration/src/nsOperaProfileMigrator.cpp
@@ -80,29 +80,21 @@
 #define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("Opera 6 Preferences")
 #define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("Opera Global History")
 #define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Bookmarks")
 #elif defined (XP_UNIX)
 #define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING(".opera")
 #define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini")
 #define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
 #define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr")
-#elif defined (XP_BEOS)
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera.ini")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera.adr")
 #else
 #error Need to define location of Opera Profile data.
 #endif
 
 #define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies4.dat")
-#ifdef XP_BEOS
-#define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies.dat")
-#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsBrowserProfileMigrator
 
 NS_IMPL_ISUPPORTS1(nsOperaProfileMigrator, nsIBrowserProfileMigrator)
 
 nsOperaProfileMigrator::nsOperaProfileMigrator()
 {
--- a/browser/components/migration/src/nsPhoenixProfileMigrator.cpp
+++ b/browser/components/migration/src/nsPhoenixProfileMigrator.cpp
@@ -284,21 +284,16 @@ nsPhoenixProfileMigrator::FillProfileDat
   
   phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
   phoenixRegistry->Append(NS_LITERAL_STRING("Application Registry"));
 #elif defined(XP_UNIX)
   fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
   
   phoenixRegistry->Append(NS_LITERAL_STRING(".phoenix"));
   phoenixRegistry->Append(NS_LITERAL_STRING("appreg"));
-#elif defined(XP_BEOS)
-   fileLocator->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
-
-   phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
-   phoenixRegistry->Append(NS_LITERAL_STRING("appreg"));
 #elif defined(XP_OS2)
   fileLocator->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
   
   phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
   phoenixRegistry->Append(NS_LITERAL_STRING("registry.dat"));
 #endif
 
 
--- a/browser/components/migration/src/nsProfileMigrator.cpp
+++ b/browser/components/migration/src/nsProfileMigrator.cpp
@@ -319,22 +319,16 @@ nsProfileMigrator::ImportRegistryProfile
   regFile->AppendNative(aAppName);
   regFile->AppendNative(NS_LITERAL_CSTRING("Application Registry"));
 #elif defined(XP_OS2)
   rv = dirService->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile),
                        getter_AddRefs(regFile));
   NS_ENSURE_SUCCESS(rv, PR_FALSE);
   regFile->AppendNative(aAppName);
   regFile->AppendNative(NS_LITERAL_CSTRING("registry.dat"));
-#elif defined(XP_BEOS)
-  rv = dirService->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile),
-                       getter_AddRefs(regFile));
-  NS_ENSURE_SUCCESS(rv, PR_FALSE);
-  regFile->AppendNative(aAppName);
-  regFile->AppendNative(NS_LITERAL_CSTRING("appreg"));
 #else
   rv = dirService->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile),
                        getter_AddRefs(regFile));
   NS_ENSURE_SUCCESS(rv, PR_FALSE);
   nsCAutoString dotAppName;
   ToLowerCase(aAppName, dotAppName);
   dotAppName.Insert('.', 0);
   
--- a/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -317,21 +317,16 @@ nsSeamonkeyProfileMigrator::FillProfileD
   
   seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
   seamonkeyRegistry->Append(NS_LITERAL_STRING("Application Registry"));
 #elif defined(XP_UNIX)
   fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
   
   seamonkeyRegistry->Append(NS_LITERAL_STRING(".mozilla"));
   seamonkeyRegistry->Append(NS_LITERAL_STRING("appreg"));
-#elif defined(XP_BEOS)
-   fileLocator->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
-
-   seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
-   seamonkeyRegistry->Append(NS_LITERAL_STRING("appreg"));
 #elif defined(XP_OS2)
   fileLocator->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
   
   seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
   seamonkeyRegistry->Append(NS_LITERAL_STRING("registry.dat"));
 #endif
 
   return GetProfileDataFromRegistry(seamonkeyRegistry, mProfileNames, mProfileLocations);
--- a/browser/components/places/content/browserPlacesViews.js
+++ b/browser/components/places/content/browserPlacesViews.js
@@ -462,17 +462,17 @@ PlacesViewBase.prototype = {
       elt.removeAttribute("image");
     else if (icon != elt.getAttribute("image"))
       elt.setAttribute("image", icon);
   },
 
   nodeAnnotationChanged:
   function PVB_nodeAnnotationChanged(aPlacesNode, aAnno) {
     // All livemarks have a feedURI, so use it as our indicator.
-    if (aAnno == "livemark/feedURI") {
+    if (aAnno == PlacesUtils.LMANNO_FEEDURI) {
       let elt = aPlacesNode._DOMElement;
       if (!elt)
         throw "aPlacesNode must have _DOMElement set";
 
       let menu = elt.parentNode;
       if (!menu.hasAttribute("livemark"))
         menu.setAttribute("livemark", "true");
 
@@ -1155,17 +1155,17 @@ PlacesToolbar.prototype = {
     // We're notified for the menupopup, not the containing toolbarbutton.
     if (elt.localName == "menupopup")
       elt = elt.parentNode;
 
     if (elt.parentNode == this._rootElt) {
       // Node is on the toolbar.
 
       // All livemarks have a feedURI, so use it as our indicator.
-      if (aAnno == "livemark/feedURI") {
+      if (aAnno == PlacesUtils.LMANNO_FEEDURI) {
         elt.setAttribute("livemark", true);
       }
       return;
     }
 
     PlacesViewBase.prototype.nodeAnnotationChanged.apply(this, arguments);
   },
 
--- a/browser/components/places/content/treeView.js
+++ b/browser/components/places/content/treeView.js
@@ -836,18 +836,22 @@ PlacesTreeView.prototype = {
     this._invalidateCellValue(aNode, this.COLUMN_TYPE_TAGS);
   },
 
   nodeKeywordChanged: function PTV_nodeKeywordChanged(aNode, aNewKeyword) {
     this._invalidateCellValue(aNode, this.COLUMN_TYPE_KEYWORD);
   },
 
   nodeAnnotationChanged: function PTV_nodeAnnotationChanged(aNode, aAnno) {
-    if (aAnno == PlacesUIUtils.DESCRIPTION_ANNO)
+    if (aAnno == PlacesUIUtils.DESCRIPTION_ANNO) {
       this._invalidateCellValue(aNode, this.COLUMN_TYPE_DESCRIPTION);
+    } else if (aAnno == PlacesUtils.LMANNO_FEEDURI) {
+      // The livemark attribute is set as a cell property on the title cell.
+      this._invalidateCellValue(aNode, this.COLUMN_TYPE_TITLE);
+    }
   },
 
   nodeDateAddedChanged: function PTV_nodeDateAddedChanged(aNode, aNewValue) {
     this._invalidateCellValue(aNode, this.COLUMN_TYPE_DATEADDED);
   },
 
   nodeLastModifiedChanged:
   function PTV_nodeLastModifiedChanged(aNode, aNewValue) {
--- a/browser/components/places/tests/browser/browser_library_views_liveupdate.js
+++ b/browser/components/places/tests/browser/browser_library_views_liveupdate.js
@@ -73,18 +73,19 @@ function test() {
                 null);
 }
 
 /**
  * Adds bookmarks observer, and executes a bunch of bookmarks operations.
  */
 function startTest() {
   var bs = PlacesUtils.bookmarks;
-  // Add bookmarks observer.
+  // Add observers.
   bs.addObserver(bookmarksObserver, false);
+  PlacesUtils.annotations.addObserver(bookmarksObserver, false);
   var addedBookmarks = [];
 
   // MENU
   ok(true, "*** Acting on menu bookmarks");
   var id = bs.insertBookmark(bs.bookmarksMenuFolder,
                              PlacesUtils._uri("http://bm1.mozilla.org/"),
                              bs.DEFAULT_INDEX,
                              "bm1");
@@ -103,16 +104,21 @@ function startTest() {
   bs.setItemTitle(id, "bmf_edited");
   addedBookmarks.push(id);
   id = bs.insertBookmark(id,
                          PlacesUtils._uri("http://bmf1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "bmf1");
   addedBookmarks.push(id);
   bs.moveItem(id, bs.bookmarksMenuFolder, 0);
+  id = PlacesUtils.livemarks.createLivemarkFolderOnly(
+    bs.bookmarksMenuFolder, "bml",
+    PlacesUtils._uri("http://bml.siteuri.mozilla.org/"),
+    PlacesUtils._uri("http://bml.feeduri.mozilla.org/"), bs.DEFAULT_INDEX);
+  addedBookmarks.push(id);
 
   // TOOLBAR
   ok(true, "*** Acting on toolbar bookmarks");
   bs.insertBookmark(bs.toolbarFolder,
                     PlacesUtils._uri("http://tb1.mozilla.org/"),
                     bs.DEFAULT_INDEX,
                     "tb1");
   bs.setItemTitle(id, "tb1_edited");
@@ -131,16 +137,20 @@ function startTest() {
   bs.setItemTitle(id, "tbf_edited");
   addedBookmarks.push(id);
   id = bs.insertBookmark(id,
                          PlacesUtils._uri("http://tbf1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "bmf1");
   addedBookmarks.push(id);
   bs.moveItem(id, bs.toolbarFolder, 0);
+  id = PlacesUtils.livemarks.createLivemarkFolderOnly(
+    bs.toolbarFolder, "tbl", PlacesUtils._uri("http://tbl.siteuri.mozilla.org/"),
+    PlacesUtils._uri("http://tbl.feeduri.mozilla.org/"), bs.DEFAULT_INDEX);
+  addedBookmarks.push(id);
 
   // UNSORTED
   ok(true, "*** Acting on unsorted bookmarks");
   id = bs.insertBookmark(bs.unfiledBookmarksFolder,
                          PlacesUtils._uri("http://ub1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "ub1");
   bs.setItemTitle(id, "ub1_edited");
@@ -159,28 +169,34 @@ function startTest() {
   bs.setItemTitle(id, "ubf_edited");
   addedBookmarks.push(id);
   id = bs.insertBookmark(id,
                          PlacesUtils._uri("http://ubf1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "ubf1");
   addedBookmarks.push(id);
   bs.moveItem(id, bs.unfiledBookmarksFolder, 0);
+  id = PlacesUtils.livemarks.createLivemarkFolderOnly(
+    bs.unfiledBookmarksFolder, "bubl",
+    PlacesUtils._uri("http://bubl.siteuri.mozilla.org/"),
+    PlacesUtils._uri("http://bubl.feeduri.mozilla.org/"), bs.DEFAULT_INDEX);
+  addedBookmarks.push(id);
 
   // Remove all added bookmarks.
   addedBookmarks.forEach(function (aItem) {
     // If we remove an item after its containing folder has been removed,
     // this will throw, but we can ignore that.
     try {
       bs.removeItem(aItem);
     } catch (ex) {}
   });
 
-  // Remove bookmarks observer.
+  // Remove observers.
   bs.removeObserver(bookmarksObserver);
+  PlacesUtils.annotations.removeObserver(bookmarksObserver);
   finishTest();
 }
 
 /**
  * Restores browser state and calls finish.
  */
 function finishTest() {
   // Close Library window.
@@ -188,22 +204,46 @@ function finishTest() {
   finish();
 }
 
 /**
  * The observer is where magic happens, for every change we do it will look for
  * nodes positions in the affected views.
  */
 var bookmarksObserver = {
-  QueryInterface: function PSB_QueryInterface(aIID) {
-    if (aIID.equals(Ci.nsINavBookmarkObserver) ||
-        aIID.equals(Ci.nsISupports))
-      return this;
-    throw Cr.NS_NOINTERFACE;
+  QueryInterface: XPCOMUtils.generateQI([
+    Ci.nsINavBookmarkObserver
+  , Ci.nsIAnnotationObserver
+  ]),
+
+  // nsIAnnotationObserver
+  onItemAnnotationSet: function(aItemId, aAnnotationName) {
+    if (aAnnotationName == PlacesUtils.LMANNO_FEEDURI) {
+      // Check that item is recognized as a livemark.
+      let validator = function(aTreeRowIndex) {
+        let tree = gLibrary.PlacesOrganizer._places;
+        let livemarkAtom = Cc["@mozilla.org/atom-service;1"].
+                           getService(Ci.nsIAtomService).
+                           getAtom("livemark");
+        let properties = Cc["@mozilla.org/supports-array;1"].
+                         createInstance(Ci.nsISupportsArray);
+        tree.view.getCellProperties(aTreeRowIndex,
+                                    tree.columns.getColumnAt(0),
+                                    properties);
+        return properties.GetIndexOf(livemarkAtom) != -1;
+      };
+
+      var [node, index, valid] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places, validator);
+      isnot(node, null, "Found new Places node in left pane at " + index);
+      ok(valid, "Node is recognized as a livemark");
+    }
   },
+  onItemAnnotationRemoved: function() {},
+  onPageAnnotationSet: function() {},
+  onPageAnnotationRemoved: function() {},
 
   // nsINavBookmarkObserver
   onItemAdded: function PSB_onItemAdded(aItemId, aFolderId, aIndex, aItemType,
                                         aURI) {
     var node = null;
     var index = null;
     [node, index] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places);
     // Left pane should not be updated for normal bookmarks or separators.
--- a/browser/components/places/tests/browser/browser_views_liveupdate.js
+++ b/browser/components/places/tests/browser/browser_views_liveupdate.js
@@ -80,18 +80,19 @@ function fakeOpenPopup(aPopup) {
   aPopup.dispatchEvent(popupEvent);  
 }
 
 /**
  * Adds bookmarks observer, and executes a bunch of bookmarks operations.
  */
 function startTest() {
   var bs = PlacesUtils.bookmarks;
-  // Add bookmarks observer.
+  // Add observers.
   bs.addObserver(bookmarksObserver, false);
+  PlacesUtils.annotations.addObserver(bookmarksObserver, false);
   var addedBookmarks = [];
 
   // MENU
   info("*** Acting on menu bookmarks");
   var id = bs.insertBookmark(bs.bookmarksMenuFolder,
                              PlacesUtils._uri("http://bm1.mozilla.org/"),
                              bs.DEFAULT_INDEX,
                              "bm1");
@@ -112,16 +113,21 @@ function startTest() {
   addedBookmarks.push(id);
   id = bs.insertBookmark(id,
                          PlacesUtils._uri("http://bmf1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "bmf1");
   bs.setItemTitle(id, "bmf1_edited");
   addedBookmarks.push(id);
   bs.moveItem(id, bs.bookmarksMenuFolder, 0);
+  id = PlacesUtils.livemarks.createLivemarkFolderOnly(
+    bs.bookmarksMenuFolder, "bml",
+    PlacesUtils._uri("http://bml.siteuri.mozilla.org/"),
+    PlacesUtils._uri("http://bml.feeduri.mozilla.org/"), bs.DEFAULT_INDEX);
+  addedBookmarks.push(id);
 
   // TOOLBAR
   info("*** Acting on toolbar bookmarks");
   id = bs.insertBookmark(bs.toolbarFolder,
                          PlacesUtils._uri("http://tb1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "tb1");
   bs.setItemTitle(id, "tb1_edited");
@@ -143,16 +149,20 @@ function startTest() {
   addedBookmarks.push(id);
   id = bs.insertBookmark(id,
                          PlacesUtils._uri("http://tbf1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "tbf1");
   bs.setItemTitle(id, "tbf1_edited");
   addedBookmarks.push(id);
   bs.moveItem(id, bs.toolbarFolder, 0);
+  id = PlacesUtils.livemarks.createLivemarkFolderOnly(
+    bs.toolbarFolder, "tbl", PlacesUtils._uri("http://tbl.siteuri.mozilla.org/"),
+    PlacesUtils._uri("http://tbl.feeduri.mozilla.org/"), bs.DEFAULT_INDEX);
+  addedBookmarks.push(id);
 
   // UNSORTED
   info("*** Acting on unsorted bookmarks");
   id = bs.insertBookmark(bs.unfiledBookmarksFolder,
                          PlacesUtils._uri("http://ub1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "ub1");
   bs.setItemTitle(id, "ub1_edited");
@@ -172,28 +182,34 @@ function startTest() {
   addedBookmarks.push(id);
   id = bs.insertBookmark(id,
                          PlacesUtils._uri("http://ubf1.mozilla.org/"),
                          bs.DEFAULT_INDEX,
                          "bubf1");
   bs.setItemTitle(id, "bubf1_edited");
   addedBookmarks.push(id);
   bs.moveItem(id, bs.unfiledBookmarksFolder, 0);
+  id = PlacesUtils.livemarks.createLivemarkFolderOnly(
+    bs.unfiledBookmarksFolder, "bubl",
+    PlacesUtils._uri("http://bubl.siteuri.mozilla.org/"),
+    PlacesUtils._uri("http://bubl.feeduri.mozilla.org/"), bs.DEFAULT_INDEX);
+  addedBookmarks.push(id);
 
   // Remove all added bookmarks.
   addedBookmarks.forEach(function (aItem) {
     // If we remove an item after its containing folder has been removed,
     // this will throw, but we can ignore that.
     try {
       bs.removeItem(aItem);
     } catch (ex) {}
   });
 
-  // Remove bookmarks observer.
+  // Remove observers.
   bs.removeObserver(bookmarksObserver);
+  PlacesUtils.annotations.removeObserver(bookmarksObserver);
   finishTest();
 }
 
 /**
  * Restores browser state and calls finish.
  */
 function finishTest() {
   // Close bookmarks sidebar.
@@ -206,22 +222,57 @@ function finishTest() {
   finish();
 }
 
 /**
  * The observer is where magic happens, for every change we do it will look for
  * nodes positions in the affected views.
  */
 var bookmarksObserver = {
-  QueryInterface: function PSB_QueryInterface(aIID) {
-    if (aIID.equals(Ci.nsINavBookmarkObserver) ||
-        aIID.equals(Ci.nsISupports))
-      return this;
-    throw Cr.NS_NOINTERFACE;
+  QueryInterface: XPCOMUtils.generateQI([
+    Ci.nsINavBookmarkObserver
+  , Ci.nsIAnnotationObserver
+  ]),
+
+  // nsIAnnotationObserver
+  onItemAnnotationSet: function(aItemId, aAnnotationName) {
+    if (aAnnotationName == PlacesUtils.LMANNO_FEEDURI) {
+      var views = getViewsForFolder(PlacesUtils.bookmarks.getFolderIdForItem(aItemId));
+      ok(views.length > 0, "Found affected views (" + views.length + "): " + views);
+
+      // Check that item is recognized as a livemark.
+      let validator = function(aElementOrTreeIndex) {
+        if (typeof(aElementOrTreeIndex) == "number") {
+          var sidebar = document.getElementById("sidebar");
+          var tree = sidebar.contentDocument.getElementById("bookmarks-view");
+          let livemarkAtom = Cc["@mozilla.org/atom-service;1"].
+                             getService(Ci.nsIAtomService).
+                             getAtom("livemark");
+          let properties = Cc["@mozilla.org/supports-array;1"].
+                           createInstance(Ci.nsISupportsArray);
+          tree.view.getCellProperties(aElementOrTreeIndex,
+                                      tree.columns.getColumnAt(0),
+                                      properties);
+          return properties.GetIndexOf(livemarkAtom) != -1;
+        }
+        else {
+          return aElementOrTreeIndex.hasAttribute("livemark");
+        }
+      };
+
+      for (var i = 0; i < views.length; i++) {
+        var [node, index, valid] = searchItemInView(aItemId, views[i], validator);
+        isnot(node, null, "Found new Places node in " + views[i] + " at " + index);
+        ok(valid, "Node is recognized as a livemark");
+      }
+    }
   },
+  onItemAnnotationRemoved: function() {},
+  onPageAnnotationSet: function() {},
+  onPageAnnotationRemoved: function() {},
 
   // nsINavBookmarkObserver
   onItemAdded: function PSB_onItemAdded(aItemId, aFolderId, aIndex,
                                         aItemType, aURI) {
     var views = getViewsForFolder(aFolderId);
     ok(views.length > 0, "Found affected views (" + views.length + "): " + views);
 
     // Check that item has been added in the correct position.
--- a/browser/components/preferences/advanced.xul
+++ b/browser/components/preferences/advanced.xul
@@ -122,19 +122,16 @@
                   name="security.disable_button.openCertManager"
                   type="bool"/>
       <preference id="security.OCSP.disable_button.managecrl"
                   name="security.OCSP.disable_button.managecrl"
                   type="bool"/>
       <preference id="security.disable_button.openDeviceManager"
                   name="security.disable_button.openDeviceManager"
                   type="bool"/>
-      <preference id="privacy.donottrackheader.enabled"
-                  name="privacy.donottrackheader.enabled"
-                  type="bool"/>
     </preferences>
     
 #ifdef HAVE_SHELL_SERVICE
     <stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
     <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
 #endif
 
     <script type="application/javascript" src="chrome://browser/content/preferences/advanced.js"/>
@@ -189,20 +186,16 @@
                       accesskey="&allowHWAccel.accesskey;"
                       preference="layers.acceleration.disabled"/>
             <checkbox id="checkSpelling"
                       label="&checkSpelling.label;"
                       accesskey="&checkSpelling.accesskey;"
                       onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
                       onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
                       preference="layout.spellcheckDefault"/>
-            <checkbox id="privacyDoNotTrackPrefs"
-                      label="&doNotTrack.label;"
-                      accesskey="&doNotTrack.accesskey;"
-                      preference="privacy.donottrackheader.enabled"/>
           </groupbox>
 
 #ifdef HAVE_SHELL_SERVICE
           <!-- System Defaults -->
           <groupbox id="systemDefaultsGroup" orient="vertical">
             <caption label="&systemDefaults.label;"/>
 
             <hbox id="checkDefaultBox" align="center" flex="1">      
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -340,41 +340,29 @@ var gMainPane = {
    */
   displayDownloadDirPref: function ()
   {
     var folderListPref = document.getElementById("browser.download.folderList");
     var bundlePreferences = document.getElementById("bundlePreferences");
     var downloadFolder = document.getElementById("downloadFolder");
     var currentDirPref = document.getElementById("browser.download.dir");
 
-    // The user's download folder is based on the preferences listed above.
-    // However, if the system does not support a download folder, the
-    // actual path returned will be the system's desktop or home folder.
-    // If this is the case, skip off displaying the Download label and
-    // display Desktop, even though folderList might be 1.
-    var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
-                                .getService(Components.interfaces.nsIProperties);
-    var desk = fileLocator.get("Desk", Components.interfaces.nsILocalFile);
-    var dnldMgr = Components.classes["@mozilla.org/download-manager;1"]
-                            .getService(Components.interfaces.nsIDownloadManager);
-    var supportDownloadLabel = !dnldMgr.defaultDownloadsDirectory.equals(desk);
-
     // Used in defining the correct path to the folder icon.
     var ios = Components.classes["@mozilla.org/network/io-service;1"]
                         .getService(Components.interfaces.nsIIOService);
     var fph = ios.getProtocolHandler("file")
                  .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
     var iconUrlSpec;
       
     // Display a 'pretty' label or the path in the UI.
     if (folderListPref.value == 2) {
       // Custom path selected and is configured
       downloadFolder.label = this._getDisplayNameOfFile(currentDirPref.value);
       iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
-    } else if (folderListPref.value == 1 && supportDownloadLabel) {
+    } else if (folderListPref.value == 1) {
       // 'Downloads'
       // In 1.5, this pointed to a folder we created called 'My Downloads'
       // and was available as an option in the 1.5 drop down. On XP this
       // was in My Documents, on OSX it was in User Docs. In 2.0, we did
       // away with the drop down option, although the special label was
       // still supported for the folder if it existed. Because it was
       // not exposed it was rarely used.
       // With 3.0, a new desktop folder - 'Downloads' was introduced for
--- a/browser/components/preferences/privacy.xul
+++ b/browser/components/preferences/privacy.xul
@@ -52,16 +52,21 @@
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:html="http://www.w3.org/1999/xhtml">
 
   <prefpane id="panePrivacy"
             onpaneload="gPrivacyPane.init();"
             helpTopic="prefs-privacy">
 
     <preferences id="privacyPreferences">
+  
+      <!-- Tracking -->
+      <preference id="privacy.donottrackheader.enabled"
+                  name="privacy.donottrackheader.enabled"
+                  type="bool"/>
 
       <!-- XXX button prefs -->
       <preference id="pref.privacy.disable_button.cookie_exceptions"
                   name="pref.privacy.disable_button.cookie_exceptions"
                   type="bool"/>
       <preference id="pref.privacy.disable_button.view_cookies"
                   name="pref.privacy.disable_button.view_cookies"
                   type="bool"/>
@@ -111,16 +116,26 @@
                   type="bool"/>
 
     </preferences>
     
     <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
     
     <script type="application/javascript" src="chrome://browser/content/preferences/privacy.js"/>
 
+    <!-- Tracking -->
+    <groupbox id="trackingGroup">
+      <caption label="&tracking.label;"/>
+
+      <checkbox id="privacyDoNotTrackPrefs"
+                label="&doNotTrack.label;"
+                accesskey="&doNotTrack.accesskey;"
+                preference="privacy.donottrackheader.enabled"/>
+    </groupbox>
+
     <!-- History -->
     <groupbox id="historyGroup">
       <caption label="&history.label;"/>
 
       <hbox align="center">
         <label id="historyModeLabel"
                control="historyMode"
                accesskey="&historyHeader.pre.accesskey;">&historyHeader.pre.label;</label>
--- a/browser/components/preferences/security.xul
+++ b/browser/components/preferences/security.xul
@@ -76,18 +76,17 @@
 
     </preferences>
     
     <script type="application/javascript" src="chrome://browser/content/preferences/security.js"/>
     
     <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <!-- addons, forgery (phishing) UI -->
-    <groupbox id="addonsPhishingGroup"
-              xmlns:aaa="http://www.w3.org/2005/07/aaa">
+    <groupbox id="addonsPhishingGroup">
       <hbox id="addonInstallBox">
         <checkbox id="warnAddonInstall" flex="1"
                   label="&warnAddonInstall.label;"
                   accesskey="&warnAddonInstall.accesskey;"
                   preference="xpinstall.whitelist.required"
                   onsyncfrompreference="return gSecurityPane.readWarnAddonInstall();"/>
         <button id="addonExceptions"
                 label="&addonExceptions.label;"
--- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
@@ -462,17 +462,17 @@ PrivateBrowsingService.prototype = {
         break;
     }
   },
 
   // nsICommandLineHandler
 
   handle: function PBS_handle(aCmdLine) {
     if (aCmdLine.handleFlag("private", false))
-      ; // It has already been handled
+      aCmdLine.preventDefault = true; // It has already been handled
     else if (aCmdLine.handleFlag("private-toggle", false)) {
       if (this._autoStarted) {
         throw Cr.NS_ERROR_ABORT;
       }
       this.privateBrowsingEnabled = !this.privateBrowsingEnabled;
       this._lastChangedByCommandLine = true;
     }
   },
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -635,16 +635,22 @@
 
           // Add observer for suggest preference
           var ps2 = Components.classes["@mozilla.org/preferences-service;1"]
                               .getService(Components.interfaces.nsIPrefBranch2);
           ps2.addObserver("browser.search.suggest.enabled", this, false);
         ]]></body>
       </method>
 
+      <!--
+        This method overrides the autocomplete binding's openPopup (essentially
+        duplicating the logic from the autocomplete popup binding's
+        openAutocompletePopup method), modifying it so that the popup is aligned with
+        the inner textbox, but sized to not extend beyond the search bar border.
+      -->
       <method name="openPopup">
         <body><![CDATA[
           var popup = this.popup;
           if (!popup.mPopupOpen) {
             // Initially the panel used for the searchbar (PopupAutoComplete
             // in browser.xul) is hidden to avoid impacting startup / new
             // window performance. The base binding's openPopup would normally
             // call the overriden openAutocompletePopup in urlbarBindings.xml's
@@ -657,28 +663,36 @@
             popup.view = this.controller.QueryInterface(Components.interfaces.nsITreeView);
             popup.invalidate();
 
             popup.showCommentColumn = this.showCommentColumn;
             popup.showImageColumn = this.showImageColumn;
 
             document.popupNode = null;
 
+            const isRTL = getComputedStyle(this, "").direction == "rtl";
+
             var outerRect = this.getBoundingClientRect();
             var innerRect = this.inputField.getBoundingClientRect();
-            var width = outerRect.right - innerRect.left;
+            if (isRTL) {
+              var width = innerRect.right - outerRect.left;
+            } else {
+              var width = outerRect.right - innerRect.left;
+            }
             popup.setAttribute("width", width > 100 ? width : 100);
 
+            var yOffset = outerRect.bottom - innerRect.bottom;
+
             // setConsumeRollupEvent() before we call openPopup(), 
             // see bug #404438 for more details
             popup.popupBoxObject.setConsumeRollupEvent(
               this.consumeRollupEvent ? 
                 Ci.nsIPopupBoxObject.ROLLUP_CONSUME : 
                 Ci.nsIPopupBoxObject.ROLLUP_NO_CONSUME);
-            popup.openPopup(null, "", innerRect.left, outerRect.bottom, false, false);
+            popup.openPopup(this.inputField, "after_start", 0, yOffset, false, false);
           }
         ]]></body>
       </method>
 
       <method name="observe">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
         <parameter name="aData"/>
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -147,38 +147,51 @@ XPCOMUtils.defineLazyServiceGetter(this,
 function debug(aMsg) {
   aMsg = ("SessionStore: " + aMsg).replace(/\S{80}/g, "$&\n");
   Services.console.logStringMessage(aMsg);
 }
 
 /* :::::::: The Service ::::::::::::::: */
 
 function SessionStoreService() {
+  XPCOMUtils.defineLazyGetter(this, "_prefBranch", function () {
+    return Cc["@mozilla.org/preferences-service;1"].
+           getService(Ci.nsIPrefService).getBranch("browser.").
+           QueryInterface(Ci.nsIPrefBranch2);
+  });
+
+  // minimal interval between two save operations (in milliseconds)
+  XPCOMUtils.defineLazyGetter(this, "_interval", function () {
+    // used often, so caching/observing instead of fetching on-demand
+    this._prefBranch.addObserver("sessionstore.interval", this, true);
+    return this._prefBranch.getIntPref("sessionstore.interval");
+  });
+
+  // when crash recovery is disabled, session data is not written to disk
+  XPCOMUtils.defineLazyGetter(this, "_resume_from_crash", function () {
+    // get crash recovery state from prefs and allow for proper reaction to state changes
+    this._prefBranch.addObserver("sessionstore.resume_from_crash", this, true);
+    return this._prefBranch.getBoolPref("sessionstore.resume_from_crash");
+  });
 }
 
 SessionStoreService.prototype = {
   classID: Components.ID("{5280606b-2510-4fe0-97ef-9b5a22eafe6b}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISessionStore,
                                          Ci.nsIDOMEventListener,
                                          Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference]),
 
   // xul:tab attributes to (re)store (extensions might want to hook in here);
   // the favicon is always saved for the about:sessionrestore page
   xulAttributes: ["image"],
 
   // set default load state
   _loadState: STATE_STOPPED,
 
-  // minimal interval between two save operations (in milliseconds)
-  _interval: 15000,
-
-  // when crash recovery is disabled, session data is not written to disk
-  _resume_from_crash: true,
-
   // During the initial restore and setBrowserState calls tracks the number of
   // windows yet to be restored
   _restoreCount: 0,
 
   // whether a setBrowserState call is in progress
   _browserSetState: false,
 
   // time in milliseconds (Date.now()) when the session was last written to file
@@ -243,34 +256,23 @@ SessionStoreService.prototype = {
   },
 
 /* ........ Global Event Handlers .............. */
 
   /**
    * Initialize the component
    */
   initService: function() {
-    this._prefBranch = Services.prefs.getBranch("browser.");
-    this._prefBranch.QueryInterface(Ci.nsIPrefBranch2);
-
     OBSERVING.forEach(function(aTopic) {
       Services.obs.addObserver(this, aTopic, true);
     }, this);
 
     var pbs = Cc["@mozilla.org/privatebrowsing;1"].
               getService(Ci.nsIPrivateBrowsingService);
     this._inPrivateBrowsing = pbs.privateBrowsingEnabled;
-
-    // get interval from prefs - used often, so caching/observing instead of fetching on-demand
-    this._interval = this._prefBranch.getIntPref("sessionstore.interval");
-    this._prefBranch.addObserver("sessionstore.interval", this, true);
-    
-    // get crash recovery state from prefs and allow for proper reaction to state changes
-    this._resume_from_crash = this._prefBranch.getBoolPref("sessionstore.resume_from_crash");
-    this._prefBranch.addObserver("sessionstore.resume_from_crash", this, true);
     
     // observe prefs changes so we can modify stored data to match
     this._prefBranch.addObserver("sessionstore.max_tabs_undo", this, true);
     this._prefBranch.addObserver("sessionstore.max_windows_undo", this, true);
     
     // this pref is only read at startup, so no need to observe it
     this._sessionhistory_max_entries =
       this._prefBranch.getIntPref("sessionhistory.max_entries");
--- a/browser/components/sessionstore/test/browser/browser_522375.js
+++ b/browser/components/sessionstore/test/browser/browser_522375.js
@@ -1,10 +1,10 @@
 function test() {
-  var startup_info = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup_MOZILLA_2_0).getStartupInfo();
+  var startup_info = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup).getStartupInfo();
   // No .process info on mac
   ok(startup_info.process <= startup_info.main, "process created before main is run " + uneval(startup_info));
 
   // on linux firstPaint can happen after everything is loaded (especially with remote X)
   if (startup_info.firstPaint)
     ok(startup_info.main <= startup_info.firstPaint, "main ran before first paint " + uneval(startup_info));
 
   ok(startup_info.main < startup_info.sessionRestored, "Session restored after main " + uneval(startup_info));
--- a/browser/config/version.txt
+++ b/browser/config/version.txt
@@ -1,1 +1,1 @@
-4.0b13pre
+4.2a1pre
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -113,16 +113,30 @@ MOZ_PKG_MAC_BACKGROUND=branding/backgrou
 MOZ_PKG_MAC_ICON=branding/disk.icns
 MOZ_PKG_MAC_EXTRA=--symlink "/Applications:/ "
 endif
 
 ifndef LIBXUL_SDK
 INSTALL_SDK = 1
 endif
 
+ifneq (1_,$(if $(CROSS_COMPILE),1,0)_$(UNIVERSAL_BINARY))
+ifdef RUN_TEST_PROGRAM
+_ABS_RUN_TEST_PROGRAM = $(call core_abspath,$(RUN_TEST_PROGRAM))
+endif
+
+GENERATE_CACHE = \
+  $(_ABS_RUN_TEST_PROGRAM) $(_ABS_DIST)/bin/xpcshell$(BIN_SUFFIX) -g "$$PWD" -f $(topsrcdir)/browser/installer/precompile_cache.js -e 'populate_startupcache("omni.jar", "startupCache.zip");' && \
+  rm -rf jsloader && \
+  $(UNZIP) startupCache.zip && \
+  rm startupCache.zip && \
+  find jsloader | xargs touch -t 201001010000 && \
+  $(ZIP) -r9mX omni.jar jsloader
+endif
+
 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
 
 ifeq (bundle, $(MOZ_FS_LAYOUT))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 # Every other platform just winds up in dist/bin
 BINPATH = bin
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -79,17 +79,16 @@
 #else
 @BINPATH@/mozcrt19.dll
 @BINPATH@/mozcpp19.dll
 #endif
 #endif
 
 [browser]
 ; [Base Browser Files]
-@BINPATH@/jsloader/
 #ifndef XP_UNIX
 @BINPATH@/@MOZ_APP_NAME@.exe
 #else
 @BINPATH@/@MOZ_APP_NAME@-bin
 @BINPATH@/@MOZ_APP_NAME@
 #endif
 @BINPATH@/application.ini
 @BINPATH@/platform.ini
--- a/browser/installer/precompile_cache.js
+++ b/browser/installer/precompile_cache.js
@@ -40,110 +40,90 @@
 // see http://mxr.mozilla.org/mozilla-central/source/services/sync/Weave.js#76
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 function setenv(name, val) {
   try {
-        var environment = Components.classes["@mozilla.org/process/environment;1"].
-          getService(Components.interfaces.nsIEnvironment);
-        environment.set(name, val);
-  }
-  catch(e) {
+    var environment = Components.classes["@mozilla.org/process/environment;1"].
+      getService(Components.interfaces.nsIEnvironment);
+    environment.set(name, val);
+  } catch(e) {
     displayError("setenv", e);
   }
 }
 
 function load(url) {
-  print(url)
+  print(url);
   try {
-    Cu.import(url, null)
+    Cu.import(url, null);
   } catch(e) {
-    dump("Failed to import "+url + ":"+e+"\n");
+    dump("Failed to import " + url + ":" + e + "\n");
   }
 }
 
 function load_entries(entries, prefix) {
-  while(entries.hasMore()) {
+  while (entries.hasMore()) {
     var c = entries.getNext();
+    // Required to ensure sync js is only loaded in load_custom_entries.
+    // That function loads the sync js with the right URIs.
+    if (c.indexOf("services-sync") >= 0)
+      continue;
+    if (c.indexOf("services-crypto") >= 0)
+      continue;
     load(prefix + c);
   }
 }
 
+function load_custom_entries(entries, subst) {
+  while (entries.hasMore()) {
+    var c = entries.getNext();
+    load("resource://" + subst + "/" + c.replace("modules/" + subst + "/", ""));
+  }
+}
+
 function getGreDir() {
-  return Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("GreD", Ci.nsIFile);
+  return Cc["@mozilla.org/file/directory_service;1"].
+    getService(Ci.nsIProperties).get("GreD", Ci.nsIFile);
 }
 
 function openJar(file) {
-  var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
+  var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
+    createInstance(Ci.nsIZipReader);
   zipreader.open(file);
   return zipreader;
 }
 
-// Check that files can be read from after closing zipreader
-function populate_omnijar() {
+function populate_startupcache(omnijarName, startupcacheName) {
   var file = getGreDir();
-  file.append("omni.jar");
-  setenv("MOZ_STARTUP_CACHE", file.path);
+  file.append(omnijarName);
   zipreader = openJar(file);
 
-  load_entries(zipreader.findEntries("components/*js"), "resource://gre/");
-  load_entries(zipreader.findEntries("modules/*jsm"), "resource://gre/");
+  var scFile = getGreDir();
+  scFile.append(startupcacheName);
+  setenv("MOZ_STARTUP_CACHE", scFile.path);
 
   // the sync part below doesn't work as smoothly
-  let ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+  let ioService = Cc["@mozilla.org/network/io-service;1"].
+    getService(Ci.nsIIOService);
   let uri = ioService.newURI("resource:///modules/services-sync/",
                              null, null);
   let resProt = ioService.getProtocolHandler("resource")
     .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("services-sync", uri);
 
-  var entries = zipreader.findEntries("modules/services-sync/*js");
-  while(entries.hasMore()) {
-    var c = entries.getNext();
-    load("resource://services-sync/" + c.replace("modules/services-sync/", ""));
-  }
+  uri = ioService.newURI("resource:///modules/services-crypto/",
+                         null, null);
+  resProt.setSubstitution("services-crypto", uri);
+
+  load_entries(zipreader.findEntries("components/*js"), "resource://gre/");
+
+  load_custom_entries(zipreader.findEntries("modules/services-sync/*js"),
+                      "services-sync");
+  load_custom_entries(zipreader.findEntries("modules/services-crypto/*js"),
+                      "services-crypto");
+
+  load_entries(zipreader.findEntries("modules/*js"), "resource://gre/");
+  load_entries(zipreader.findEntries("modules/*jsm"), "resource://gre/");
   zipreader.close();
 }
-
-function extract_files(jar, pattern, dest) {
-  var entries = jar.findEntries(pattern);
-  while(entries.hasMore()) {
-    var c = entries.getNext();
-    var file = dest.clone();
-    for each(name in c.split("/"))
-      file.append(name);
-
-    if (!file.parent.exists()) { 
-      file.parent.create(1 /* Ci.nsIFile.DIRECTORY doesn't work*/, 0700);
-      print("Created " + file.parent.path)
-    }
-
-    if (jar.getEntry(c).isDirectory)
-      continue;
-    
-    try {
-      jar.extract(c, file);
-      print("extracted "+file.path+":"+file.fileSize);
-    }catch(e) {
-      // This shouldn't happen, but if it does it means the cache entry will be generated at runtime
-      // instead of at package-time.
-      print("Failed to extract " + file.path);
-      print(e)
-    }
-  }
-
-}
-
-function extract_jsloader_to_dist_bin() {
-  var dist_bin = getGreDir().parent;
-  dist_bin.append("bin");
-
-  var file = getGreDir();
-  file.append("omni.jar");
-
-  var zipReader = openJar(file);
-  // this should really be zipReader.extract(...), but that method is too broken
-  extract_files(zipReader, "jsloader/*", dist_bin);
-  zipReader.close();
-}
--- a/browser/installer/windows/Makefile.in
+++ b/browser/installer/windows/Makefile.in
@@ -72,38 +72,48 @@ DEFINES += \
 	-DAB_CD=$(AB_CD) \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
 	-DMOZ_APP_DISPLAYNAME=${MOZ_APP_DISPLAYNAME} \
 	-DMOZILLA_VERSION=${MOZILLA_VERSION} \
 	$(NULL)
 
 include $(topsrcdir)/config/config.mk
 
+ifdef LOCALE_MERGEDIR
+PPL_LOCALE_ARGS = \
+  --l10n-dir=$(LOCALE_MERGEDIR)/browser/installer \
+  --l10n-dir=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer \
+  --l10n-dir=$(topsrcdir)/browser/locales/en-US/installer \
+  $(NULL)
+else
+PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer
+endif
+
 installer::
 	$(MAKE) -C .. installer-stage
 	$(MAKE) $(CONFIG_DIR)/setup.exe
 
 # For building the uninstaller during the application build so it can be
 # included for mar file generation.
 uninstaller::
 	$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
 	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
 	  --preprocess-locale $(topsrcdir) \
-	  $(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer $(AB_CD) $(CONFIG_DIR)
+	  $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
 
 $(CONFIG_DIR)/setup.exe::
 	$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
 	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
 	  --preprocess-locale $(topsrcdir) \
-	  $(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer $(AB_CD) $(CONFIG_DIR)
+	  $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
 
 GARBARGE_DIRS += instgen
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -67,32 +67,32 @@ endif
 SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
 	$(NULL)
 
 # This makefile uses variable overrides from the libs-% target to
 # build non-default locales to non-default dist/ locations. Be aware!
 
+# XXXCallek Unused?
 APP_VERSION := $(shell cat $(srcdir)/../config/version.txt)
 
 PWD := $(CURDIR)
 
 # These are defaulted to be compatible with the files the wget-en-US target
 # pulls. You may override them if you provide your own files. You _must_
 # override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
 # work in that case.
 ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
 WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 RETRIEVE_WINDOWS_INSTALLER = 1
 
 MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org
 
-PREF_JS_EXPORTS = $(firstword $(wildcard $(LOCALE_SRCDIR)/firefox-l10n.js) \
-                       $(srcdir)/en-US/firefox-l10n.js )
+PREF_JS_EXPORTS = $(call MERGE_FILE,firefox-l10n.js)
 
 ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
 MOZ_PKG_MAC_DSSTORE=$(_ABS_DIST)/branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=$(_ABS_DIST)/branding/background.png
 MOZ_PKG_MAC_ICON=$(_ABS_DIST)/branding/disk.icns
 MOZ_PKG_MAC_EXTRA=--symlink "/Applications:/ "
 endif
 
@@ -120,28 +120,26 @@ libs::
 	    $(LOCALE_SRCDIR)/existing-profile-defaults.js > $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
 	fi
 install::
 	@if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
 	  $(PERL) $(topsrcdir)/config/preprocessor.pl $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
 	    $(LOCALE_SRCDIR)/existing-profile-defaults.js > $(DESTDIR)$(mozappdir)/defaults/existing-profile-defaults.js; \
 	fi
 
-README_FILES = \
-	README.txt \
-	$(NULL)
+README_FILE = $(call MERGE_FILE,README.txt)
 
 PROFILE_FILES = \
 	localstore.rdf \
 	mimeTypes.rdf \
 	$(NULL)
 
 PROFILE_CHROME = userChrome-example.css userContent-example.css
 
-libs:: $(addprefix $(LOCALE_SRCDIR)/,$(README_FILES))
+libs:: $(README_FILE)
 ifeq ($(OS_ARCH),WINNT)
 	$(EXIT_ON_ERROR) \
 	for file in $^; do \
 	  $(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $$file > $(FINAL_TARGET)/`basename $$file`; \
 	done
 else
 ifneq ($(OS_ARCH),OS2)
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
@@ -158,28 +156,28 @@ NO_JA_JP_MAC_AB_CD := $(if $(filter ja-J
 	  $(srcdir)/generic/profile/bookmarks.html.in \
 	  > $@
 
 libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
 
 libs:: $(addprefix generic/profile/,$(PROFILE_FILES))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
 
-libs:: $(addprefix $(LOCALE_SRCDIR)/profile/chrome/,$(PROFILE_CHROME))
+libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
 
 install:: $(DESTDIR)$(mozappdir)/defaults/profile/bookmarks.html ;
 
 install:: $(addprefix generic/profile/,$(PROFILE_FILES))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile
 
-install:: $(addprefix $(LOCALE_SRCDIR)/profile/chrome/,$(PROFILE_CHROME))
+install:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile/chrome
 
-SEARCH_PLUGINS = $(shell cat $(LOCALE_SRCDIR)/searchplugins/list.txt)
+SEARCH_PLUGINS = $(shell cat $(call MERGE_FILE,/searchplugins/list.txt))
 
 libs:: $(addsuffix .xml,$(SEARCH_PLUGINS))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/searchplugins
 
 install:: $(addsuffix .xml,$(SEARCH_PLUGINS))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/searchplugins
 
 
@@ -187,41 +185,36 @@ libs-%:
 	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C ../../toolkit/locales libs-$* BOTH_MANIFESTS=1
 	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
 	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref BOTH_MANIFESTS=1
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
 
 
-repackage-win32-installer: WIN32_INSTALLER_OUT="$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
-repackage-win32-installer: $(WIN32_INSTALLER_IN) $(SUBMAKEFILES)
+repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
+repackage-win32-installer: $(call ESCAPE_SPACE,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
 	@echo "Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
 	$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
 	$(MAKE) repackage-zip \
 	  AB_CD=$(AB_CD) \
 	  MOZ_PKG_FORMAT=SFX7Z \
-	  ZIP_IN=$(WIN32_INSTALLER_IN) \
-	  ZIP_OUT=$(WIN32_INSTALLER_OUT) \
+	  ZIP_IN="$(WIN32_INSTALLER_IN)" \
+	  ZIP_OUT="$(WIN32_INSTALLER_OUT)" \
 	  SFX_HEADER="$(PWD)/../installer/windows/l10ngen/7zSD.sfx \
 	              $(topsrcdir)/browser/installer/windows/app.tag"
 
 ifeq (WINNT,$(OS_ARCH))
-repackage-win32-installer-%: $(WIN32_INSTALLER_IN) libs-%
-	@$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN=$(WIN32_INSTALLER_IN)
+repackage-win32-installer-%:
+	@$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN="$(WIN32_INSTALLER_IN)"
 else
 repackage-win32-installer-%: ;
 endif
 
-ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
-STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS
-else
-STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)
-endif
 
 clobber-zip:
 	$(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
 	  $(STAGEDIST)/chrome/$(AB_CD).manifest \
 	  $(STAGEDIST)/defaults/pref/firefox-l10n.js
 	$(RM) -rf  $(STAGEDIST)/searchplugins \
 	  $(STAGEDIST)/dictionaries \
 	  $(STAGEDIST)/defaults/profile \
@@ -233,17 +226,17 @@ langpack: langpack-$(AB_CD)
 # This is a generic target that will make a langpack, repack ZIP (+tarball)
 # builds, and repack an installer if applicable. It is called from the
 # tinderbox scripts. Alter it with caution.
 
 installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
 	@echo "repackaging done"
 
 ifdef MOZ_UPDATER
-libs:: $(addprefix $(LOCALE_SRCDIR)/,updater/updater.ini)
+libs:: $(call MERGE_FILE,updater/updater.ini)
 ifeq ($(OS_ARCH),WINNT)
 	cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
 	  sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
 	  sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
 	  $(FINAL_TARGET)/updater.ini
 else
 	cat $< | \
 	  sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
@@ -252,69 +245,30 @@ else
 endif
 endif
 
 ifdef MOZ_CRASHREPORTER
 libs:: crashreporter-override.ini
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
 endif
 
-
 ident:
 	@printf "fx_revision "
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App SourceStamp
 	@printf "buildid "
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App BuildID
 
-#These make targets call prepare-repackages by setting different UPLOAD_DIR
-prepare-upload-latest-%:
-	@$(MAKE) prepare-repackages-$* UPLOAD_DIR=$(DIST)/upload/latest
-
-prepare-upload-dated-%:
-	@$(MAKE) prepare-repackages-$* UPLOAD_DIR=$(DIST)/upload/`date "+%Y-%m-%d-%H"`-$(MOZ_PKG_APPNAME)$(MOZ_APP_VERSION)-l10n
-
-#Each platform uploads their xpi files to different folders
-ifeq (Linux, $(OS_ARCH))
-XPI_DESTINATION = linux-xpi
-endif
-ifeq (Darwin, $(OS_ARCH))
-XPI_DESTINATION = mac-xpi
-endif
-ifeq (WINNT, $(OS_ARCH))
-XPI_DESTINATION = windows-xpi
-endif
-
-# This target will generate a UPLOAD_DIR folder with
-# l10n repackages in the way that we offer l10n nightlies
-#  1) ./ the binary
-#  2) ./{linux,mac,windows}-xpi/locale.xpi
-prepare-repackages-%:
-ifndef XPI_DESTINATION
-	$(error XPI_DESTINATION not defined; \
-	This is the folder where the xpi files will be moved to)
-endif
-ifndef UPLOAD_DIR
-	$(error UPLOAD_DIR not defined)
-endif
-	$(NSINSTALL) -D $(UPLOAD_DIR)
-	$(NSINSTALL) -D $(UPLOAD_DIR)/$(XPI_DESTINATION)
-# Move the langpack
-	mv $(DIST)/install/firefox-$(MOZ_APP_VERSION).$*.langpack.xpi \
-	   $(UPLOAD_DIR)/$(XPI_DESTINATION)/$*.xpi
-# Move the repackage
-	mv $(DIST)/firefox-$(MOZ_APP_VERSION).$*.* \
-	   $(UPLOAD_DIR)/.
-# Move the windows installer
-ifeq (WINNT, $(OS_ARCH))
-	mv $(DIST)/install/sea/firefox-$(MOZ_APP_VERSION).$*.win32.installer.exe \
-	   $(UPLOAD_DIR)/.
-endif
-# Set the permissions that the folders will have in ftp once uploaded
-	chmod -vR 775 $(UPLOAD_DIR)
-
 merge-%:
 ifdef LOCALE_MERGEDIR
 	$(RM) -rf $(LOCALE_MERGEDIR)
 	MACOSX_DEPLOYMENT_TARGET= compare-locales -m $(LOCALE_MERGEDIR) $(srcdir)/l10n.ini $(L10NBASEDIR) $*
 endif
 	@echo
+
+# test target, depends on make package
+# try to repack x-test, with just toolkit/defines.inc being there
+l10n-check::
+	$(RM) -rf x-test
+	$(NSINSTALL) -D x-test/toolkit
+	echo "#define MOZ_LANG_TITLE Just testing" > x-test/toolkit/defines.inc
+	$(MAKE) installers-x-test L10NBASEDIR="$(PWD)" LOCALE_MERGEDIR="$(PWD)/mergedir"
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -301,16 +301,17 @@ addKeywordTitleAutoFill=Search %S
 tabView2.title=%S - Group Your Tabs
 
 extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
 extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.
 
 # safeModeRestart
 safeModeRestartPromptTitle=Restart with Add-ons Disabled
 safeModeRestartPromptMessage=Are you sure you want to disable all add-ons and restart?
+safeModeRestartButton=Restart
 
 # LOCALIZATION NOTE (browser.menu.showCharacterEncoding): Set to the string
 # "true" (spelled and capitalized exactly that way) to show the "Character
 # Encoding" menu in the main Firefox button on Windows. Any other value will
 # hide it. Regardless of the value of this setting, the "Character Encoding"
 # menu will always be accessible via the "Web Developer" menu.
 # This is not a string to translate; it just controls whether the menu shows
 # up in the Firefox button. If users frequently use the "Character Encoding"
--- a/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
@@ -16,18 +16,16 @@
 <!ENTITY useAutoScroll.label             "Use autoscrolling">
 <!ENTITY useAutoScroll.accesskey         "a">
 <!ENTITY useSmoothScrolling.label        "Use smooth scrolling">
 <!ENTITY useSmoothScrolling.accesskey    "m">
 <!ENTITY allowHWAccel.label              "Use hardware acceleration when available">
 <!ENTITY allowHWAccel.accesskey          "h">
 <!ENTITY checkSpelling.label             "Check my spelling as I type">
 <!ENTITY checkSpelling.accesskey         "t">
-<!ENTITY doNotTrack.label                "Tell web sites I do not want to be tracked">
-<!ENTITY doNotTrack.accesskey            "d">
 
 <!ENTITY systemDefaults.label            "System Defaults">
 <!ENTITY alwaysCheckDefault.label        "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
 <!ENTITY alwaysCheckDefault.accesskey    "w">
 <!ENTITY checkNow.label                  "Check Now">
 <!ENTITY checkNow.accesskey              "N">
 <!ENTITY submitCrashes.label             "Submit crash reports">
 <!ENTITY submitCrashes.accesskey         "S">
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -1,8 +1,13 @@
+<!ENTITY tracking.label                 "Tracking">
+
+<!ENTITY doNotTrack.label               "Tell web sites I do not want to be tracked">
+<!ENTITY doNotTrack.accesskey           "d">
+
 <!ENTITY  history.label                 "History">
 
 <!ENTITY  locationBar.label             "Location Bar">
 
 <!ENTITY  locbar.pre.label              "When using the location bar, suggest:">
 <!ENTITY  locbar.pre.accessKey          "u">
 <!ENTITY  locbar.post.label             "">
 <!ENTITY  locbar.both.label             "History and Bookmarks">
@@ -25,17 +30,16 @@
 <!ENTITY  askEachTime.label             "ask me every time">
 
 <!ENTITY  cookieExceptions.label        "Exceptions…">
 <!ENTITY  cookieExceptions.accesskey    "E">
 
 <!ENTITY  showCookies.label             "Show Cookies…">
 <!ENTITY  showCookies.accesskey         "S">
 
-
 <!ENTITY  historyHeader.pre.label          "&brandShortName; will:">
 <!ENTITY  historyHeader.pre.accesskey      "w">
 <!ENTITY  historyHeader.remember.label     "Remember history">
 <!ENTITY  historyHeader.dontremember.label "Never remember history">
 <!ENTITY  historyHeader.custom.label       "Use custom settings for history">
 <!ENTITY  historyHeader.post.label         "">
 
 <!ENTITY  rememberDescription.label      "&brandShortName; will remember your browsing, download, form and search history, and keep cookies from Web sites you visit.">
--- a/browser/themes/gnomestripe/browser/browser.css
+++ b/browser/themes/gnomestripe/browser/browser.css
@@ -1384,16 +1384,17 @@ richlistitem[type~="action"][actiontype=
 #TabsToolbar {
   min-height: 0;
   padding: 0;
 }
 
 #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
   -moz-appearance: menubar;
   color: -moz-menubartext;
+  box-shadow: 0 -1px 0 rgba(0,0,0,.1) inset;
 }
 
 #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme):-moz-system-metric(menubar-drag) {
   -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
 }