Merge from tracemonkey to jsdbg2.
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 25 May 2011 17:52:35 -0500
changeset 74455 a34a276b47c5c0bd6ecb1391c6500b201bc9134d
parent 74454 a52fba05829489dcc15e77e1a7111639843d672f (current diff)
parent 70615 c8695a65e1e74ed04648564fb9f730a32e428aed (diff)
child 74456 d249478fbbe1828131c1d7388dfb361378e501fe
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone6.0a1
Merge from tracemonkey to jsdbg2.
accessible/tests/mochitest/events/test_aria_hidden.html
browser/components/migration/src/nsCaminoProfileMigrator.cpp
browser/components/migration/src/nsCaminoProfileMigrator.h
browser/components/migration/src/nsDogbertProfileMigrator.cpp
browser/components/migration/src/nsDogbertProfileMigrator.h
browser/components/migration/src/nsICabProfileMigrator.cpp
browser/components/migration/src/nsICabProfileMigrator.h
browser/components/migration/src/nsMacIEProfileMigrator.cpp
browser/components/migration/src/nsMacIEProfileMigrator.h
browser/components/migration/src/nsOmniWebProfileMigrator.cpp
browser/components/migration/src/nsOmniWebProfileMigrator.h
browser/components/migration/src/nsPhoenixProfileMigrator.cpp
browser/components/migration/src/nsPhoenixProfileMigrator.h
browser/themes/pinstripe/browser/places/livemarkItem.png
browser/themes/winstripe/browser/places/dropDown-aero.png
browser/themes/winstripe/browser/places/libraryNavigation-aero.png
browser/themes/winstripe/browser/places/libraryNavigation.png
config/preprocessor.pl
config/preprocessor.txt
dom/interfaces/range/nsIDOMDocumentRange.idl
dom/plugins/base/nsIPluginInstance.idl
js/src/Makefile.in
js/src/config/preprocessor.pl
js/src/jit-test/jit_test.py
js/src/jsapi.cpp
js/src/jscntxt.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/jsgc.cpp
js/src/jsinterp.cpp
js/src/jsobj.cpp
js/src/jsprvtd.h
js/src/jsstr.cpp
js/src/jsvector.h
js/src/methodjit/TrampolineCompiler.cpp
js/src/yarr/Makefile
js/src/yarr/jswtfbridge.h
js/src/yarr/pcre/AUTHORS
js/src/yarr/pcre/COPYING
js/src/yarr/pcre/chartables.c
js/src/yarr/pcre/dftables
js/src/yarr/pcre/pcre.h
js/src/yarr/pcre/pcre.pri
js/src/yarr/pcre/pcre_compile.cpp
js/src/yarr/pcre/pcre_exec.cpp
js/src/yarr/pcre/pcre_internal.h
js/src/yarr/pcre/pcre_tables.cpp
js/src/yarr/pcre/pcre_ucp_searchfuncs.cpp
js/src/yarr/pcre/pcre_xclass.cpp
js/src/yarr/pcre/ucpinternal.h
js/src/yarr/pcre/ucptable.cpp
js/src/yarr/wtf/ASCIICType.h
js/src/yarr/yarr/RegExpJitTables.h
js/src/yarr/yarr/RegexCommon.h
js/src/yarr/yarr/RegexCompiler.cpp
js/src/yarr/yarr/RegexCompiler.h
js/src/yarr/yarr/RegexJIT.cpp
js/src/yarr/yarr/RegexJIT.h
js/src/yarr/yarr/RegexParser.h
js/src/yarr/yarr/RegexPattern.h
layout/reftests/css-invalid/input/success-ref.html
modules/lib7z/7zLib.cpp
modules/lib7z/7zLib.h
modules/lib7z/7zobjs.mk
modules/lib7z/LZMASDK/7zC.txt
modules/lib7z/LZMASDK/7zFormat.txt
modules/lib7z/LZMASDK/Asm/x64/7zCrcT8U.asm
modules/lib7z/LZMASDK/Asm/x86/7zCrcT8U.asm
modules/lib7z/LZMASDK/C/7z.h
modules/lib7z/LZMASDK/C/7zBuf.c
modules/lib7z/LZMASDK/C/7zBuf.h
modules/lib7z/LZMASDK/C/7zBuf2.c
modules/lib7z/LZMASDK/C/7zCrc.c
modules/lib7z/LZMASDK/C/7zCrc.h
modules/lib7z/LZMASDK/C/7zCrcT8.c
modules/lib7z/LZMASDK/C/7zDec.c
modules/lib7z/LZMASDK/C/7zFile.c
modules/lib7z/LZMASDK/C/7zFile.h
modules/lib7z/LZMASDK/C/7zIn.c
modules/lib7z/LZMASDK/C/7zStream.c
modules/lib7z/LZMASDK/C/7zVersion.h
modules/lib7z/LZMASDK/C/Alloc.c
modules/lib7z/LZMASDK/C/Alloc.h
modules/lib7z/LZMASDK/C/Bcj2.c
modules/lib7z/LZMASDK/C/Bcj2.h
modules/lib7z/LZMASDK/C/Bra.c
modules/lib7z/LZMASDK/C/Bra.h
modules/lib7z/LZMASDK/C/Bra86.c
modules/lib7z/LZMASDK/C/BraIA64.c
modules/lib7z/LZMASDK/C/CpuArch.h
modules/lib7z/LZMASDK/C/Delta.c
modules/lib7z/LZMASDK/C/Delta.h
modules/lib7z/LZMASDK/C/LzFind.c
modules/lib7z/LZMASDK/C/LzFind.h
modules/lib7z/LZMASDK/C/LzFindMt.c
modules/lib7z/LZMASDK/C/LzFindMt.h
modules/lib7z/LZMASDK/C/LzHash.h
modules/lib7z/LZMASDK/C/Lzma2Dec.c
modules/lib7z/LZMASDK/C/Lzma2Dec.h
modules/lib7z/LZMASDK/C/Lzma2Enc.c
modules/lib7z/LZMASDK/C/Lzma2Enc.h
modules/lib7z/LZMASDK/C/Lzma86.h
modules/lib7z/LZMASDK/C/Lzma86Dec.c
modules/lib7z/LZMASDK/C/Lzma86Enc.c
modules/lib7z/LZMASDK/C/LzmaDec.c
modules/lib7z/LZMASDK/C/LzmaDec.h
modules/lib7z/LZMASDK/C/LzmaEnc.c
modules/lib7z/LZMASDK/C/LzmaEnc.h
modules/lib7z/LZMASDK/C/LzmaLib.c
modules/lib7z/LZMASDK/C/LzmaLib.h
modules/lib7z/LZMASDK/C/MtCoder.c
modules/lib7z/LZMASDK/C/MtCoder.h
modules/lib7z/LZMASDK/C/RotateDefs.h
modules/lib7z/LZMASDK/C/Sha256.c
modules/lib7z/LZMASDK/C/Sha256.h
modules/lib7z/LZMASDK/C/Threads.c
modules/lib7z/LZMASDK/C/Threads.h
modules/lib7z/LZMASDK/C/Types.h
modules/lib7z/LZMASDK/C/Util/7z/7z.dsp
modules/lib7z/LZMASDK/C/Util/7z/7z.dsw
modules/lib7z/LZMASDK/C/Util/7z/7zAlloc.c
modules/lib7z/LZMASDK/C/Util/7z/7zAlloc.h
modules/lib7z/LZMASDK/C/Util/7z/7zMain.c
modules/lib7z/LZMASDK/C/Util/7z/makefile
modules/lib7z/LZMASDK/C/Util/7z/makefile.gcc
modules/lib7z/LZMASDK/C/Util/Lzma/LzmaUtil.c
modules/lib7z/LZMASDK/C/Util/Lzma/LzmaUtil.dsp
modules/lib7z/LZMASDK/C/Util/Lzma/LzmaUtil.dsw
modules/lib7z/LZMASDK/C/Util/Lzma/makefile
modules/lib7z/LZMASDK/C/Util/Lzma/makefile.gcc
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLib.def
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLib.dsp
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLib.dsw
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLibExports.c
modules/lib7z/LZMASDK/C/Util/LzmaLib/makefile
modules/lib7z/LZMASDK/C/Util/LzmaLib/resource.rc
modules/lib7z/LZMASDK/C/Xz.c
modules/lib7z/LZMASDK/C/Xz.h
modules/lib7z/LZMASDK/C/XzCrc64.c
modules/lib7z/LZMASDK/C/XzCrc64.h
modules/lib7z/LZMASDK/C/XzDec.c
modules/lib7z/LZMASDK/C/XzEnc.c
modules/lib7z/LZMASDK/C/XzEnc.h
modules/lib7z/LZMASDK/C/XzIn.c
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zCompressionMode.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zCompressionMode.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zDecode.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zDecode.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zEncode.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zEncode.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zExtract.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderInStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderInStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderOutStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderOutStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHandler.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHandlerOut.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHeader.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHeader.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zIn.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zIn.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zItem.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zOut.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zOut.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zProperties.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zProperties.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zSpecStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zSpecStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zUpdate.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zUpdate.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Archive.def
modules/lib7z/LZMASDK/CPP/7zip/Archive/Archive2.def
modules/lib7z/LZMASDK/CPP/7zip/Archive/ArchiveExports.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2MT.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2MT.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CrossThreadProgress.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CrossThreadProgress.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/DummyOutStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/DummyOutStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/HandlerOut.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/HandlerOut.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/InStreamWithCRC.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/InStreamWithCRC.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ItemNameUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ItemNameUtils.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/MultiStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/MultiStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/OutStreamWithCRC.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ParseProperties.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ParseProperties.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/DllExports2.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/IArchive.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Icons/7z.ico
modules/lib7z/LZMASDK/CPP/7zip/Archive/LzmaHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/SplitHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/XzHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/Alone.dsp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/Alone.dsw
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/makefile
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/resource.rc
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/makefile
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/resource.rc
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/makefile
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/resource.rc
modules/lib7z/LZMASDK/CPP/7zip/Common/CWrappers.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/CWrappers.h
modules/lib7z/LZMASDK/CPP/7zip/Common/CreateCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/CreateCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Common/FilePathAutoRename.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/FilePathAutoRename.h
modules/lib7z/LZMASDK/CPP/7zip/Common/FileStreams.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/FileStreams.h
modules/lib7z/LZMASDK/CPP/7zip/Common/FilterCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/FilterCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Common/InBuffer.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/InBuffer.h
modules/lib7z/LZMASDK/CPP/7zip/Common/InOutTempBuffer.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/InOutTempBuffer.h
modules/lib7z/LZMASDK/CPP/7zip/Common/LimitedStreams.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/LimitedStreams.h
modules/lib7z/LZMASDK/CPP/7zip/Common/LockedStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/LockedStream.h
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodId.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodId.h
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodProps.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodProps.h
modules/lib7z/LZMASDK/CPP/7zip/Common/OffsetStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/OffsetStream.h
modules/lib7z/LZMASDK/CPP/7zip/Common/OutBuffer.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/OutBuffer.h
modules/lib7z/LZMASDK/CPP/7zip/Common/ProgressUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/ProgressUtils.h
modules/lib7z/LZMASDK/CPP/7zip/Common/RegisterArc.h
modules/lib7z/LZMASDK/CPP/7zip/Common/RegisterCodec.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamBinder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamBinder.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamObjects.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamObjects.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamUtils.h
modules/lib7z/LZMASDK/CPP/7zip/Common/VirtThread.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/VirtThread.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Bcj2Coder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/Bcj2Coder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Bcj2Register.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BcjCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BcjCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/BcjRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchMisc.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchMisc.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/ByteSwap.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/CodecExports.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/CopyCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/CopyCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/CopyRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/DeltaFilter.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsw
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBench.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/makefile
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Decoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Decoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Encoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Encoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Register.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaDecoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaDecoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaEncoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaEncoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/RangeCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/RangeCoderBit.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Crc.mak
modules/lib7z/LZMASDK/CPP/7zip/Crc2.mak
modules/lib7z/LZMASDK/CPP/7zip/Guid.txt
modules/lib7z/LZMASDK/CPP/7zip/ICoder.h
modules/lib7z/LZMASDK/CPP/7zip/IDecl.h
modules/lib7z/LZMASDK/CPP/7zip/IPassword.h
modules/lib7z/LZMASDK/CPP/7zip/IProgress.h
modules/lib7z/LZMASDK/CPP/7zip/IStream.h
modules/lib7z/LZMASDK/CPP/7zip/MyVersion.h
modules/lib7z/LZMASDK/CPP/7zip/MyVersionInfo.rc
modules/lib7z/LZMASDK/CPP/7zip/PropID.h
modules/lib7z/LZMASDK/CPP/7zip/SubBuild.mak
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/Client7z.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/Client7z.dsp
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/Client7z.dsw
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/makefile
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveCommandLine.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveExtractCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveName.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveName.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveOpenCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/DefaultName.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/DefaultName.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/DirItem.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/EnumDirItems.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/EnumDirItems.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExitCode.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Extract.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Extract.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExtractMode.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExtractingFilePath.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExtractingFilePath.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/IFileExtractCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/LoadCodecs.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/LoadCodecs.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/OpenArchive.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/OpenArchive.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/PropIDUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/PropIDUtils.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Property.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SetProperties.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SetProperties.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SortUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SortUtils.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/TempFiles.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/TempFiles.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Update.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Update.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateAction.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateAction.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateCallback.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdatePair.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdatePair.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateProduce.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateProduce.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/WorkDir.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/WorkDir.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ZipRegistry.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ConsoleClose.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ConsoleClose.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ExtractCallbackConsole.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/List.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/List.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/Main.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/MainAr.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/OpenCallbackConsole.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/OpenCallbackConsole.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/PercentPrinter.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/PercentPrinter.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UpdateCallbackConsole.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UserInputUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UserInputUtils.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/makefile
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/resource.rc
modules/lib7z/LZMASDK/CPP/Build.mak
modules/lib7z/LZMASDK/CPP/Common/AutoPtr.h
modules/lib7z/LZMASDK/CPP/Common/Buffer.h
modules/lib7z/LZMASDK/CPP/Common/CRC.cpp
modules/lib7z/LZMASDK/CPP/Common/C_FileIO.cpp
modules/lib7z/LZMASDK/CPP/Common/C_FileIO.h
modules/lib7z/LZMASDK/CPP/Common/ComTry.h
modules/lib7z/LZMASDK/CPP/Common/CommandLineParser.cpp
modules/lib7z/LZMASDK/CPP/Common/CommandLineParser.h
modules/lib7z/LZMASDK/CPP/Common/Defs.h
modules/lib7z/LZMASDK/CPP/Common/DynamicBuffer.h
modules/lib7z/LZMASDK/CPP/Common/IntToString.cpp
modules/lib7z/LZMASDK/CPP/Common/IntToString.h
modules/lib7z/LZMASDK/CPP/Common/ListFileUtils.cpp
modules/lib7z/LZMASDK/CPP/Common/ListFileUtils.h
modules/lib7z/LZMASDK/CPP/Common/MyCom.h
modules/lib7z/LZMASDK/CPP/Common/MyException.h
modules/lib7z/LZMASDK/CPP/Common/MyGuidDef.h
modules/lib7z/LZMASDK/CPP/Common/MyInitGuid.h
modules/lib7z/LZMASDK/CPP/Common/MyString.cpp
modules/lib7z/LZMASDK/CPP/Common/MyString.h
modules/lib7z/LZMASDK/CPP/Common/MyUnknown.h
modules/lib7z/LZMASDK/CPP/Common/MyVector.cpp
modules/lib7z/LZMASDK/CPP/Common/MyVector.h
modules/lib7z/LZMASDK/CPP/Common/MyWindows.h
modules/lib7z/LZMASDK/CPP/Common/NewHandler.cpp
modules/lib7z/LZMASDK/CPP/Common/NewHandler.h
modules/lib7z/LZMASDK/CPP/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/Common/StdInStream.cpp
modules/lib7z/LZMASDK/CPP/Common/StdInStream.h
modules/lib7z/LZMASDK/CPP/Common/StdOutStream.cpp
modules/lib7z/LZMASDK/CPP/Common/StdOutStream.h
modules/lib7z/LZMASDK/CPP/Common/StringConvert.cpp
modules/lib7z/LZMASDK/CPP/Common/StringConvert.h
modules/lib7z/LZMASDK/CPP/Common/StringToInt.cpp
modules/lib7z/LZMASDK/CPP/Common/StringToInt.h
modules/lib7z/LZMASDK/CPP/Common/Types.h
modules/lib7z/LZMASDK/CPP/Common/UTFConvert.cpp
modules/lib7z/LZMASDK/CPP/Common/UTFConvert.h
modules/lib7z/LZMASDK/CPP/Common/Wildcard.cpp
modules/lib7z/LZMASDK/CPP/Common/Wildcard.h
modules/lib7z/LZMASDK/CPP/Windows/DLL.cpp
modules/lib7z/LZMASDK/CPP/Windows/DLL.h
modules/lib7z/LZMASDK/CPP/Windows/Defs.h
modules/lib7z/LZMASDK/CPP/Windows/Error.cpp
modules/lib7z/LZMASDK/CPP/Windows/Error.h
modules/lib7z/LZMASDK/CPP/Windows/FileDir.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileDir.h
modules/lib7z/LZMASDK/CPP/Windows/FileFind.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileFind.h
modules/lib7z/LZMASDK/CPP/Windows/FileIO.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileIO.h
modules/lib7z/LZMASDK/CPP/Windows/FileMapping.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileMapping.h
modules/lib7z/LZMASDK/CPP/Windows/FileName.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileName.h
modules/lib7z/LZMASDK/CPP/Windows/Handle.h
modules/lib7z/LZMASDK/CPP/Windows/MemoryLock.cpp
modules/lib7z/LZMASDK/CPP/Windows/MemoryLock.h
modules/lib7z/LZMASDK/CPP/Windows/NtCheck.h
modules/lib7z/LZMASDK/CPP/Windows/PropVariant.cpp
modules/lib7z/LZMASDK/CPP/Windows/PropVariant.h
modules/lib7z/LZMASDK/CPP/Windows/PropVariantConversions.cpp
modules/lib7z/LZMASDK/CPP/Windows/PropVariantConversions.h
modules/lib7z/LZMASDK/CPP/Windows/Registry.cpp
modules/lib7z/LZMASDK/CPP/Windows/Registry.h
modules/lib7z/LZMASDK/CPP/Windows/StdAfx.h
modules/lib7z/LZMASDK/CPP/Windows/Synchronization.cpp
modules/lib7z/LZMASDK/CPP/Windows/Synchronization.h
modules/lib7z/LZMASDK/CPP/Windows/System.cpp
modules/lib7z/LZMASDK/CPP/Windows/System.h
modules/lib7z/LZMASDK/CPP/Windows/Thread.h
modules/lib7z/LZMASDK/CPP/Windows/Time.cpp
modules/lib7z/LZMASDK/CPP/Windows/Time.h
modules/lib7z/LZMASDK/CS/7zip/Common/CRC.cs
modules/lib7z/LZMASDK/CS/7zip/Common/CommandLineParser.cs
modules/lib7z/LZMASDK/CS/7zip/Common/InBuffer.cs
modules/lib7z/LZMASDK/CS/7zip/Common/OutBuffer.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/IMatchFinder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/LzBinTree.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/LzInWindow.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/LzOutWindow.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZMA/LzmaBase.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZMA/LzmaDecoder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZMA/LzmaEncoder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaBench.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/RangeCoder/RangeCoder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs
modules/lib7z/LZMASDK/CS/7zip/ICoder.cs
modules/lib7z/LZMASDK/Java/SevenZip/CRC.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZ/BinTree.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZ/InWindow.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZ/OutWindow.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZMA/Base.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZMA/Decoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZMA/Encoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/Decoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/Encoder.java
modules/lib7z/LZMASDK/Java/SevenZip/ICodeProgress.java
modules/lib7z/LZMASDK/Java/SevenZip/LzmaAlone.java
modules/lib7z/LZMASDK/Java/SevenZip/LzmaBench.java
modules/lib7z/LZMASDK/Methods.txt
modules/lib7z/LZMASDK/README.mozilla
modules/lib7z/LZMASDK/history.txt
modules/lib7z/LZMASDK/lzma.txt
modules/lib7z/Makefile.in
modules/plugin/Makefile.in
modules/plugin/test/Makefile.in
modules/plugin/test/crashtests/110650-1.html
modules/plugin/test/crashtests/41276-1.html
modules/plugin/test/crashtests/48856-1.html
modules/plugin/test/crashtests/539897-1.html
modules/plugin/test/crashtests/540114-1.html
modules/plugin/test/crashtests/570884.html
modules/plugin/test/crashtests/598862.html
modules/plugin/test/crashtests/626602-1.html
modules/plugin/test/crashtests/crashtests.list
modules/plugin/test/mochitest/307-xo-redirect.sjs
modules/plugin/test/mochitest/Makefile.in
modules/plugin/test/mochitest/cocoa_focus.html
modules/plugin/test/mochitest/cocoa_window_focus.html
modules/plugin/test/mochitest/crashing_subpage.html
modules/plugin/test/mochitest/large-pic.jpg
modules/plugin/test/mochitest/loremipsum.txt
modules/plugin/test/mochitest/loremipsum.xtest
modules/plugin/test/mochitest/loremipsum.xtest^headers^
modules/plugin/test/mochitest/loremipsum_file.txt
modules/plugin/test/mochitest/loremipsum_nocache.txt
modules/plugin/test/mochitest/loremipsum_nocache.txt^headers^
modules/plugin/test/mochitest/neverending.sjs
modules/plugin/test/mochitest/plugin_visibility_loader.html
modules/plugin/test/mochitest/plugin_window.html
modules/plugin/test/mochitest/pluginstream.js
modules/plugin/test/mochitest/post.sjs
modules/plugin/test/mochitest/test_GCrace.html
modules/plugin/test/mochitest/test_bug479979.xul
modules/plugin/test/mochitest/test_bug532208.html
modules/plugin/test/mochitest/test_bug539565-1.html
modules/plugin/test/mochitest/test_bug539565-2.html
modules/plugin/test/mochitest/test_clear_site_data.html
modules/plugin/test/mochitest/test_cocoa_focus.html
modules/plugin/test/mochitest/test_cocoa_window_focus.html
modules/plugin/test/mochitest/test_convertpoint.xul
modules/plugin/test/mochitest/test_cookies.html
modules/plugin/test/mochitest/test_copyText.html
modules/plugin/test/mochitest/test_crash_nested_loop.html
modules/plugin/test/mochitest/test_crash_notify.xul
modules/plugin/test/mochitest/test_crash_notify_no_report.xul
modules/plugin/test/mochitest/test_crash_submit.xul
modules/plugin/test/mochitest/test_crashing.html
modules/plugin/test/mochitest/test_crashing2.html
modules/plugin/test/mochitest/test_enumerate.html
modules/plugin/test/mochitest/test_fullpage.html
modules/plugin/test/mochitest/test_getauthenticationinfo.html
modules/plugin/test/mochitest/test_hanging.html
modules/plugin/test/mochitest/test_instantiation.html
modules/plugin/test/mochitest/test_multipleinstanceobjects.html
modules/plugin/test/mochitest/test_newstreamondestroy.html
modules/plugin/test/mochitest/test_npn_asynccall.html
modules/plugin/test/mochitest/test_npn_timers.html
modules/plugin/test/mochitest/test_npobject_getters.html
modules/plugin/test/mochitest/test_npruntime.xul
modules/plugin/test/mochitest/test_npruntime_construct.html
modules/plugin/test/mochitest/test_npruntime_identifiers.html
modules/plugin/test/mochitest/test_npruntime_npnevaluate.html
modules/plugin/test/mochitest/test_npruntime_npninvoke.html
modules/plugin/test/mochitest/test_npruntime_npninvokedefault.html
modules/plugin/test/mochitest/test_npruntime_npnsetexception.html
modules/plugin/test/mochitest/test_painting.html
modules/plugin/test/mochitest/test_plugin_scroll_painting.html
modules/plugin/test/mochitest/test_pluginstream_asfile.html
modules/plugin/test/mochitest/test_pluginstream_asfileonly.html
modules/plugin/test/mochitest/test_pluginstream_err.html
modules/plugin/test/mochitest/test_pluginstream_geturl.html
modules/plugin/test/mochitest/test_pluginstream_geturlnotify.html
modules/plugin/test/mochitest/test_pluginstream_newstream.html
modules/plugin/test/mochitest/test_pluginstream_post.html
modules/plugin/test/mochitest/test_pluginstream_poststream.html
modules/plugin/test/mochitest/test_pluginstream_seek.html
modules/plugin/test/mochitest/test_pluginstream_seek_close.html
modules/plugin/test/mochitest/test_pluginstream_src.html
modules/plugin/test/mochitest/test_positioning.html
modules/plugin/test/mochitest/test_privatemode.xul
modules/plugin/test/mochitest/test_propertyAndMethod.html
modules/plugin/test/mochitest/test_redirect_handling.html
modules/plugin/test/mochitest/test_streamNotify.html
modules/plugin/test/mochitest/test_streamatclose.html
modules/plugin/test/mochitest/test_twostreams.html
modules/plugin/test/mochitest/test_visibility.html
modules/plugin/test/mochitest/test_windowed_invalidate.html
modules/plugin/test/mochitest/test_wmode.xul
modules/plugin/test/mochitest/test_xulbrowser_plugin_visibility.xul
modules/plugin/test/mochitest/utils.js
modules/plugin/test/mochitest/xulbrowser_plugin_visibility.xul
modules/plugin/test/reftest/border-padding-1-ref.html
modules/plugin/test/reftest/border-padding-1.html
modules/plugin/test/reftest/border-padding-2-ref.html
modules/plugin/test/reftest/border-padding-2.html
modules/plugin/test/reftest/border-padding-3-ref.html
modules/plugin/test/reftest/border-padding-3.html
modules/plugin/test/reftest/div-alpha-opacity.html
modules/plugin/test/reftest/div-alpha-zindex.html
modules/plugin/test/reftest/div-sanity.html
modules/plugin/test/reftest/plugin-alpha-opacity.html
modules/plugin/test/reftest/plugin-alpha-zindex.html
modules/plugin/test/reftest/plugin-background-1-step.html
modules/plugin/test/reftest/plugin-background-10-step.html
modules/plugin/test/reftest/plugin-background-2-step.html
modules/plugin/test/reftest/plugin-background-5-step.html
modules/plugin/test/reftest/plugin-background-ref.html
modules/plugin/test/reftest/plugin-background.css
modules/plugin/test/reftest/plugin-background.html
modules/plugin/test/reftest/plugin-background.js
modules/plugin/test/reftest/plugin-busy-alpha-zindex.html
modules/plugin/test/reftest/plugin-canvas-alpha-zindex.html
modules/plugin/test/reftest/plugin-sanity.html
modules/plugin/test/reftest/plugin-transform-1-ref.html
modules/plugin/test/reftest/plugin-transform-1.html
modules/plugin/test/reftest/plugin-transform-2-ref.html
modules/plugin/test/reftest/plugin-transform-2.html
modules/plugin/test/reftest/plugin-transform-alpha-zindex.html
modules/plugin/test/reftest/pluginproblemui-direction-1-ref.html
modules/plugin/test/reftest/pluginproblemui-direction-1.html
modules/plugin/test/reftest/pluginproblemui-direction-2-ref.html
modules/plugin/test/reftest/pluginproblemui-direction-2.html
modules/plugin/test/reftest/reftest.list
modules/plugin/test/reftest/windowless-clipping-1-ref.html
modules/plugin/test/reftest/windowless-clipping-1.html
modules/plugin/test/testplugin/Info.plist
modules/plugin/test/testplugin/Makefile.in
modules/plugin/test/testplugin/README
modules/plugin/test/testplugin/nptest.cpp
modules/plugin/test/testplugin/nptest.def
modules/plugin/test/testplugin/nptest.h
modules/plugin/test/testplugin/nptest.rc
modules/plugin/test/testplugin/nptest_droid.cpp
modules/plugin/test/testplugin/nptest_gtk2.cpp
modules/plugin/test/testplugin/nptest_macosx.mm
modules/plugin/test/testplugin/nptest_os2.cpp
modules/plugin/test/testplugin/nptest_platform.h
modules/plugin/test/testplugin/nptest_qt.cpp
modules/plugin/test/testplugin/nptest_utils.cpp
modules/plugin/test/testplugin/nptest_utils.h
modules/plugin/test/testplugin/nptest_windows.cpp
modules/plugin/test/unit/head_plugins.js
modules/plugin/test/unit/test_bug455213.js
modules/plugin/test/unit/test_bug471245.js
testing/mochitest/harness-a11y.xul
testing/mochitest/pywebsocket/mod_pywebsocket/handshake/handshake.py
testing/mochitest/pywebsocket_ignore_sigint.py
testing/mochitest/redirect-a11y.html
xpcom/base/nsTelemetry.cpp
--- a/.hgtags
+++ b/.hgtags
@@ -57,8 +57,9 @@ 138f593553b66c9f815e8f57870c19d6347f7702
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R11_1_MU
 e56ecd8b3a68c158025207c5fd081d043e28f5ce GECKO_2_0_BASE
 e273946b74c8d631ed86bd74ba9afe0e67b12378 GECKO_2_1_BASE
 b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE
 b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE_20110406
 a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE
 a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE_20110406
 a95d426422816513477e5863add1b00ac7041dcb AURORA_BASE_20110412
+138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R14
--- a/Makefile.in
+++ b/Makefile.in
@@ -157,17 +157,17 @@ endif
 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
 
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
 endif
 
-export SYMBOL_INDEX_NAME = \
+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
@@ -189,17 +189,17 @@ endif
 	grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
 	  mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
 	cd $(DIST)/crashreporter-symbols && \
           zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
 endif # MOZ_CRASHREPORTER
 
 uploadsymbols:
 ifdef MOZ_CRASHREPORTER
-	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
+	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
 endif
 
 # defined in package-name.mk
 export MOZ_SOURCE_STAMP
 
 #XXX: this is a hack, since we don't want to clobber for MSVC
 # PGO support, but we can't do this test in client.mk
 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -336,19 +336,17 @@ void nsAccessibleWrap::SetMaiHyperlink(M
 {
     NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
     NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
     if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
         MaiHyperlink* maiHyperlink = GetMaiHyperlink(PR_FALSE);
         if (!maiHyperlink && !aMaiHyperlink) {
             return; // Never set and we're shutting down
         }
-        if (maiHyperlink) {
-            delete maiHyperlink;
-        }
+        delete maiHyperlink;
         g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink,
                            aMaiHyperlink);
     }
 }
 
 NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
 {
     *aOutAccessible = nsnull;
--- a/accessible/src/base/nsAccDocManager.h
+++ b/accessible/src/base/nsAccDocManager.h
@@ -194,33 +194,42 @@ private:
 
 #define NS_LOG_ACCDOC_URI(aDocument)                                           \
   nsIURI *uri = aDocument->GetDocumentURI();                                   \
   nsCAutoString spec;                                                          \
   uri->GetSpec(spec);                                                          \
   printf("uri: %s", spec);
 
 #define NS_LOG_ACCDOC_TYPE(aDocument)                                          \
-  PRBool isContent = nsCoreUtils::IsContentDocument(aDocument);                \
-  printf("%s document", (isContent ? "content" : "chrome"));
+  if (aDocument->IsActive()) {                                                 \
+    PRBool isContent = nsCoreUtils::IsContentDocument(aDocument);              \
+    printf("%s document", (isContent ? "content" : "chrome"));                 \
+  } else {                                                                     \
+    printf("document type: [failed]");                                         \
+  }
 
 #define NS_LOG_ACCDOC_SHELLSTATE(aDocument)                                    \
+  nsCAutoString docShellBusy;                                                  \
   nsCOMPtr<nsISupports> container = aDocument->GetContainer();                 \
-  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);               \
-  PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;                           \
-  docShell->GetBusyFlags(&busyFlags);                                          \
-  nsCAutoString docShellBusy;                                                  \
-  if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)                               \
-    docShellBusy.AppendLiteral("'none'");                                      \
-  if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)                                \
-    docShellBusy.AppendLiteral("'busy'");                                      \
-  if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)                    \
-    docShellBusy.AppendLiteral(", 'before page load'");                        \
-  if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)                        \
-    docShellBusy.AppendLiteral(", 'page loading'");                            \
+  if (container) {                                                             \
+    nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);             \
+    PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;                         \
+    docShell->GetBusyFlags(&busyFlags);                                        \
+    if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)                             \
+      docShellBusy.AppendLiteral("'none'");                                    \
+    if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)                              \
+      docShellBusy.AppendLiteral("'busy'");                                    \
+    if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)                  \
+      docShellBusy.AppendLiteral(", 'before page load'");                      \
+    if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)                      \
+      docShellBusy.AppendLiteral(", 'page loading'");                          \
+  }                                                                            \
+  else {                                                                       \
+    docShellBusy.AppendLiteral("[failed]");                                    \
+  }                                                                            \
   printf("docshell busy: %s", docShellBusy.get());
 
 #define NS_LOG_ACCDOC_DOCSTATES(aDocument)                                     \
   const char *docState = 0;                                                    \
   nsIDocument::ReadyState docStateFlag = aDocument->GetReadyStateEnum();       \
   switch (docStateFlag) {                                                      \
     case nsIDocument::READYSTATE_UNINITIALIZED:                                \
      docState = "uninitialized";                                               \
@@ -331,30 +340,32 @@ private:
 
 #define NS_LOG_ACCDOC_DOCINFO_BEGIN                                            \
   printf("  {\n");
 #define NS_LOG_ACCDOC_DOCINFO_BODY(aDocument, aDocAcc)                         \
   {                                                                            \
     printf("    ");                                                            \
     NS_LOG_ACCDOC_ADDRESS(aDocument, aDocAcc)                                  \
     printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_URI(aDocument)                                               \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_SHELLSTATE(aDocument)                                        \
-    printf("; ");                                                              \
-    NS_LOG_ACCDOC_TYPE(aDocument)                                              \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_DOCSTATES(aDocument)                                         \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_DOCPRESSHELL(aDocument)                                      \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_DOCLOADGROUP(aDocument)                                      \
-    printf(", ");                                                              \
-    NS_LOG_ACCDOC_DOCPARENT(aDocument)                                         \
-    printf("\n");                                                              \
+    if (aDocument) {                                                           \
+      NS_LOG_ACCDOC_URI(aDocument)                                             \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_SHELLSTATE(aDocument)                                      \
+      printf("; ");                                                            \
+      NS_LOG_ACCDOC_TYPE(aDocument)                                            \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_DOCSTATES(aDocument)                                       \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_DOCPRESSHELL(aDocument)                                    \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_DOCLOADGROUP(aDocument)                                    \
+      printf(", ");                                                            \
+      NS_LOG_ACCDOC_DOCPARENT(aDocument)                                       \
+      printf("\n");                                                            \
+    }                                                                          \
   }
 #define NS_LOG_ACCDOC_DOCINFO_END                                              \
   printf("  }\n");
 
 #define NS_LOG_ACCDOC_DOCINFO(aDocument, aDocAcc)                              \
   NS_LOG_ACCDOC_DOCINFO_BEGIN                                                  \
   NS_LOG_ACCDOC_DOCINFO_BODY(aDocument, aDocAcc)                               \
   NS_LOG_ACCDOC_DOCINFO_END
--- a/accessible/src/base/nsAccTreeWalker.cpp
+++ b/accessible/src/base/nsAccTreeWalker.cpp
@@ -62,17 +62,17 @@ struct WalkState
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccTreeWalker
 ////////////////////////////////////////////////////////////////////////////////
 
 nsAccTreeWalker::
   nsAccTreeWalker(nsIWeakReference* aShell, nsIContent* aContent,
                   PRBool aWalkAnonContent, bool aWalkCache) :
-  mWeakShell(aShell), mState(nsnull), mWalkCache(aWalkCache)
+  mWeakShell(aShell), mWalkCache(aWalkCache), mState(nsnull)
 {
   NS_ASSERTION(aContent, "No node for the accessible tree walker!");
 
   if (aContent)
     mState = new WalkState(aContent);
 
   mChildFilter = aWalkAnonContent ? nsIContent::eAllChildren :
                                   nsIContent::eAllButXBL;
--- a/accessible/src/base/nsAccUtils.cpp
+++ b/accessible/src/base/nsAccUtils.cpp
@@ -155,17 +155,18 @@ nsAccUtils::GetPositionAndSizeForXULSele
   *aSetSize = itemsCount;
   *aPosInSet = indexOf;
 
   for (PRUint32 index = 0; index < itemsCount; index++) {
     nsCOMPtr<nsIDOMXULSelectControlItemElement> currItem;
     control->GetItemAtIndex(index, getter_AddRefs(currItem));
     nsCOMPtr<nsINode> currNode(do_QueryInterface(currItem));
 
-    nsAccessible* itemAcc = GetAccService()->GetAccessible(currNode);
+    nsAccessible* itemAcc = currNode ?
+      GetAccService()->GetAccessible(currNode) : nsnull;
 
     if (!itemAcc || itemAcc->State() & states::INVISIBLE) {
       (*aSetSize)--;
       if (index < static_cast<PRUint32>(indexOf))
         (*aPosInSet)--;
     }
   }
 
@@ -196,17 +197,18 @@ nsAccUtils::GetPositionAndSizeForXULCont
 
   // Calculate set size and position in the set.
   *aSetSize = 0, *aPosInSet = 0;
   for (PRInt32 index = indexOf; index >= 0; index--) {
     nsCOMPtr<nsIDOMXULElement> item;
     container->GetItemAtIndex(index, getter_AddRefs(item));
     nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
 
-    nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
+    nsAccessible* itemAcc = itemNode ?
+      GetAccService()->GetAccessible(itemNode) : nsnull;
 
     if (itemAcc) {
       PRUint32 itemRole = Role(itemAcc);
       if (itemRole == nsIAccessibleRole::ROLE_SEPARATOR)
         break; // We reached the beginning of our group.
 
       if (!(itemAcc->State() & states::INVISIBLE)) {
         (*aSetSize)++;
@@ -215,18 +217,19 @@ nsAccUtils::GetPositionAndSizeForXULCont
     }
   }
 
   for (PRInt32 index = indexOf + 1; index < static_cast<PRInt32>(itemsCount);
        index++) {
     nsCOMPtr<nsIDOMXULElement> item;
     container->GetItemAtIndex(index, getter_AddRefs(item));
     nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
-    
-    nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
+
+    nsAccessible* itemAcc =
+      itemNode ? GetAccService()->GetAccessible(itemNode) : nsnull;
 
     if (itemAcc) {
       PRUint32 itemRole = Role(itemAcc);
       if (itemRole == nsIAccessibleRole::ROLE_SEPARATOR)
         break; // We reached the end of our group.
 
       if (!(itemAcc->State() & states::INVISIBLE))
         (*aSetSize)++;
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -166,17 +166,17 @@ public:
   {
     return GetNode() && GetNode()->IsNodeOfType(nsINode::eCONTENT);
   }
   bool IsElement() const
   {
     nsINode* node = GetNode();
     return node && node->IsElement();
   }
-  PRBool IsDocument() const
+  bool IsDocumentNode() const
   {
     return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
   }
 
   /**
    * Return the corresponding press shell for this accessible.
    */
   already_AddRefed<nsIPresShell> GetPresShell();
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -63,17 +63,17 @@
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLOptGroupElement.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMXULElement.h"
 #include "nsIHTMLDocument.h"
 #include "nsImageFrame.h"
 #include "nsILink.h"
 #include "nsIObserverService.h"
-#include "nsIPluginInstance.h"
+#include "nsNPAPIPluginInstance.h"
 #include "nsISupportsUtils.h"
 #include "nsObjectFrame.h"
 #include "nsOuterDocAccessible.h"
 #include "nsRootAccessibleWrap.h"
 #include "nsTextFragment.h"
 #include "mozilla/Services.h"
 #include "nsEventStates.h"
 
@@ -341,18 +341,18 @@ nsAccessibilityService::CreateHTMLObject
     nsCOMPtr<nsIDOMDocument> domDoc;
     obj->GetContentDocument(getter_AddRefs(domDoc));
     if (domDoc)
       return CreateOuterDocAccessible(aContent, aPresShell);
   }
 
 #if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
   // 2) for plugins
-  nsCOMPtr<nsIPluginInstance> pluginInstance;
-  if (NS_SUCCEEDED(aFrame->GetPluginInstance(*getter_AddRefs(pluginInstance))) &&
+  nsRefPtr<nsNPAPIPluginInstance> pluginInstance;
+  if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) &&
       pluginInstance) {
 #ifdef XP_WIN
     // Note: pluginPort will be null if windowless.
     HWND pluginPort = nsnull;
     aFrame->GetPluginPort(&pluginPort);
 
     nsAccessible* accessible = new nsHTMLWin32ObjectOwnerAccessible(aContent,
                                                                     weakShell,
@@ -837,16 +837,18 @@ nsAccessibilityService::GetAccessibleInS
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService public
 
 nsAccessible*
 nsAccessibilityService::GetAccessible(nsINode* aNode)
 {
+  NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash.");
+
   nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
   return document ? document->GetAccessible(aNode) : nsnull;
 }
 
 nsAccessible*
 nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode,
                                                  nsIWeakReference* aWeakShell)
 {
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -52,17 +52,16 @@
 #include "nsAccTreeWalker.h"
 #include "nsRelUtils.h"
 #include "nsTextEquivUtils.h"
 #include "States.h"
 
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentXBL.h"
-#include "nsIDOMDocumentTraversal.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMTreeWalker.h"
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMXULElement.h"
@@ -3215,26 +3214,25 @@ nsAccessible::GetSiblingAtOffset(PRInt32
 nsAccessible *
 nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
 {
   nsAccessible* accessible =
     GetAccService()->GetAccessibleInWeakShell(aStartNode, mWeakShell);
   if (accessible)
     return accessible;
 
-  nsCOMPtr<nsIDOMDocumentTraversal> trav =
-    do_QueryInterface(aStartNode->GetOwnerDoc());
-  NS_ENSURE_TRUE(trav, nsnull);
+  nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->GetOwnerDoc());
+  NS_ENSURE_TRUE(domDoc, nsnull);
 
   nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
-  nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(GetNode()));
+  nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
   nsCOMPtr<nsIDOMTreeWalker> walker;
-  trav->CreateTreeWalker(rootNode,
-                         nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
-                         nsnull, PR_FALSE, getter_AddRefs(walker));
+  domDoc->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;
 
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -371,16 +371,19 @@ public:
    */
   void TestChildCache(nsAccessible* aCachedChild) const;
 
   //////////////////////////////////////////////////////////////////////////////
   // Downcasting
 
   inline bool IsApplication() const { return mFlags & eApplicationAccessible; }
 
+  inline bool IsDoc() const { return mFlags & eDocAccessible; }
+  nsDocAccessible* AsDoc();
+
   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();
@@ -524,20 +527,21 @@ protected:
     { mFlags = (mFlags & ~kChildrenFlagsMask) | aFlag; }
 
   /**
    * Flags describing the accessible itself.
    * @note keep these flags in sync with ChildrenFlags
    */
   enum AccessibleTypes {
     eApplicationAccessible = 1 << 2,
-    eHyperTextAccessible = 1 << 3,
-    eHTMLListItemAccessible = 1 << 4,
-    eRootAccessible = 1 << 5,
-    eTextLeafAccessible = 1 << 6
+    eDocAccessible = 1 << 3,
+    eHyperTextAccessible = 1 << 4,
+    eHTMLListItemAccessible = 1 << 5,
+    eRootAccessible = 1 << 6,
+    eTextLeafAccessible = 1 << 7
   };
 
   //////////////////////////////////////////////////////////////////////////////
   // Miscellaneous helpers
 
   /**
    * Return ARIA role (helper method).
    */
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -88,76 +88,65 @@ nsLeafAccessible::CacheChildren()
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsLinkableAccessible::
   nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsAccessibleWrap(aContent, aShell),
-  mActionContent(nsnull),
+  mActionAcc(nsnull),
   mIsLink(PR_FALSE),
   mIsOnclick(PR_FALSE)
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible. nsIAccessible
 
 NS_IMETHODIMP
 nsLinkableAccessible::TakeFocus()
 {
-  nsAccessible *actionAcc = GetActionAccessible();
-  if (actionAcc)
-    return actionAcc->TakeFocus();
-
-  return nsAccessibleWrap::TakeFocus();
+  return mActionAcc ? mActionAcc->TakeFocus() : nsAccessibleWrap::TakeFocus();
 }
 
 PRUint64
 nsLinkableAccessible::NativeState()
 {
   PRUint64 states = nsAccessibleWrap::NativeState();
   if (mIsLink) {
     states |= states::LINKED;
-    nsAccessible* actionAcc = GetActionAccessible();
-    if (actionAcc->State() & states::TRAVERSED)
+    if (mActionAcc->State() & states::TRAVERSED)
       states |= states::TRAVERSED;
   }
 
   return states;
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetValue(nsAString& aValue)
 {
   aValue.Truncate();
 
   nsAccessible::GetValue(aValue);
   if (!aValue.IsEmpty())
     return NS_OK;
 
-  if (mIsLink) {
-    nsAccessible *actionAcc = GetActionAccessible();
-    if (actionAcc)
-      return actionAcc->GetValue(aValue);
-  }
-
-  return NS_ERROR_NOT_IMPLEMENTED;
+  return mIsLink ? mActionAcc->GetValue(aValue) : NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetNumActions(PRUint8 *aNumActions)
 {
   NS_ENSURE_ARG_POINTER(aNumActions);
 
-  *aNumActions = mActionContent ? 1 : 0;
+  *aNumActions = mActionAcc ? 1 : 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   aName.Truncate();
 
@@ -177,125 +166,99 @@ nsLinkableAccessible::GetActionName(PRUi
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::DoAction(PRUint8 aIndex)
 {
   if (aIndex != eAction_Jump)
     return NS_ERROR_INVALID_ARG;
 
-  nsAccessible *actionAcc = GetActionAccessible();
-  if (actionAcc)
-    return actionAcc->DoAction(aIndex);
-  
-  return nsAccessibleWrap::DoAction(aIndex);
+  return mActionAcc ? mActionAcc->DoAction(aIndex) :
+    nsAccessibleWrap::DoAction(aIndex);
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetKeyboardShortcut(nsAString& aKeyboardShortcut)
 {
   aKeyboardShortcut.Truncate();
 
-  nsAccessible *actionAcc = GetActionAccessible();
-  if (actionAcc)
-    return actionAcc->GetKeyboardShortcut(aKeyboardShortcut);
-
-  return nsAccessible::GetKeyboardShortcut(aKeyboardShortcut);
+  return mActionAcc ? mActionAcc->GetKeyboardShortcut(aKeyboardShortcut) :
+    nsAccessible::GetKeyboardShortcut(aKeyboardShortcut);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible. nsAccessNode
 
 void
 nsLinkableAccessible::Shutdown()
 {
-  mActionContent = nsnull;
+  mIsLink = PR_FALSE;
+  mIsOnclick = PR_FALSE;
+  mActionAcc = nsnull;
   nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible: HyperLinkAccessible
 
 already_AddRefed<nsIURI>
 nsLinkableAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
 {
   if (mIsLink) {
-    nsAccessible* link = GetActionAccessible();
-    if (link) {
-      NS_ASSERTION(link->IsHyperLink(),
-                   "nsIAccessibleHyperLink isn't implemented.");
+    NS_ASSERTION(mActionAcc->IsHyperLink(),
+                 "nsIAccessibleHyperLink isn't implemented.");
 
-      if (link->IsHyperLink())
-        return link->GetAnchorURI(aAnchorIndex);
-    }
+    if (mActionAcc->IsHyperLink())
+      return mActionAcc->GetAnchorURI(aAnchorIndex);
   }
 
   return nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible: nsAccessible protected
 
 void
 nsLinkableAccessible::BindToParent(nsAccessible* aParent,
                                    PRUint32 aIndexInParent)
 {
   nsAccessibleWrap::BindToParent(aParent, aIndexInParent);
 
   // Cache action content.
-  mActionContent = nsnull;
+  mActionAcc = nsnull;
   mIsLink = PR_FALSE;
   mIsOnclick = PR_FALSE;
 
-  nsIContent* walkUpContent = mContent;
-  PRBool isOnclick = nsCoreUtils::HasClickListener(walkUpContent);
-
-  if (isOnclick) {
-    mActionContent = walkUpContent;
+  if (nsCoreUtils::HasClickListener(mContent)) {
+    mActionAcc = this;
     mIsOnclick = PR_TRUE;
     return;
   }
 
-  while ((walkUpContent = walkUpContent->GetParent())) {
-    nsAccessible* walkUpAcc =
-      GetAccService()->GetAccessibleInWeakShell(walkUpContent, mWeakShell);
-
+  // XXX: The logic looks broken since the click listener may be registered
+  // on non accessible node in parent chain but this node is skipped when tree
+  // is traversed.
+  nsAccessible* walkUpAcc = this;
+  while ((walkUpAcc = walkUpAcc->GetParent()) && !walkUpAcc->IsDoc()) {
     if (walkUpAcc && walkUpAcc->Role() == nsIAccessibleRole::ROLE_LINK &&
         walkUpAcc->State() & states::LINKED) {
       mIsLink = PR_TRUE;
-      mActionContent = walkUpContent;
+      mActionAcc = walkUpAcc;
       return;
     }
 
-    isOnclick = nsCoreUtils::HasClickListener(walkUpContent);
-    if (isOnclick) {
-      mActionContent = walkUpContent;
+    if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
+      mActionAcc = walkUpAcc;
       mIsOnclick = PR_TRUE;
       return;
     }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsLinkableAccessible: protected
-
-nsAccessible *
-nsLinkableAccessible::GetActionAccessible() const
-{
-  // Return accessible for the action content if it's different from node of
-  // this accessible. If the action accessible is not null then it is used to
-  // redirect methods calls otherwise we use method implementation from the
-  // base class.
-  if (!mActionContent || mContent == mActionContent)
-    return nsnull;
-
-  return GetAccService()->GetAccessibleInWeakShell(mActionContent, mWeakShell);
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // nsEnumRoleAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsEnumRoleAccessible::
   nsEnumRoleAccessible(nsIContent *aNode, nsIWeakReference *aShell,
                        PRUint32 aRole) :
   nsAccessibleWrap(aNode, aShell), mRole(aRole)
 {
--- a/accessible/src/base/nsBaseWidgetAccessible.h
+++ b/accessible/src/base/nsBaseWidgetAccessible.h
@@ -103,24 +103,20 @@ public:
 
   // HyperLinkAccessible
   virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
 
 protected:
   // nsAccessible
   virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
 
-  // nsLinkableAccessible
-
   /**
-   * Return an accessible for cached action node.
+   * Parent accessible that provides an action for this linkable accessible.
    */
-  nsAccessible *GetActionAccessible() const;
-
-  nsCOMPtr<nsIContent> mActionContent;
+  nsAccessible* mActionAcc;
   PRPackedBool mIsLink;
   PRPackedBool mIsOnclick;
 };
 
 /**
  * A simple accessible that gets its enumerated role passed into constructor.
  */ 
 class nsEnumRoleAccessible : public nsAccessibleWrap
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -488,22 +488,20 @@ nsCoreUtils::IsErrorPage(nsIDocument *aD
   PRBool isAboutScheme = PR_FALSE;
   uri->SchemeIs("about", &isAboutScheme);
   if (!isAboutScheme)
     return PR_FALSE;
 
   nsCAutoString path;
   uri->GetPath(path);
 
-  nsCAutoString::const_iterator start, end;
-  path.BeginReading(start);
-  path.EndReading(end);
+  NS_NAMED_LITERAL_CSTRING(neterror, "neterror");
+  NS_NAMED_LITERAL_CSTRING(certerror, "certerror");
 
-  NS_NAMED_LITERAL_CSTRING(neterror, "neterror");
-  return FindInReadable(neterror, start, end);
+  return StringBeginsWith(path, neterror) || StringBeginsWith(path, certerror);
 }
 
 PRBool
 nsCoreUtils::IsCorrectFrameType(nsIFrame *aFrame, nsIAtom *aAtom)
 {
   NS_ASSERTION(aFrame != nsnull,
                "aFrame is null in call to IsCorrectFrameType!");
   NS_ASSERTION(aAtom != nsnull,
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -104,16 +104,18 @@ static const PRUint32 kRelationAttrsLen 
 
 nsDocAccessible::
   nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
                   nsIWeakReference *aShell) :
   nsHyperTextAccessibleWrap(aRootContent, aShell),
   mDocument(aDocument), mScrollPositionChangedTicks(0), mIsLoaded(PR_FALSE),
   mCacheRoot(nsnull), mIsPostCacheProcessing(PR_FALSE)
 {
+  mFlags |= eDocAccessible;
+
   mDependentIDsHash.Init();
   // XXX aaronl should we use an algorithm for the initial cache size?
   mAccessibleCache.Init(kDefaultCacheSize);
   mNodeToAccessibleMap.Init(kDefaultCacheSize);
 
   // If this is a XUL Document, it should not implement nsHyperText
   if (mDocument && mDocument->IsXUL())
     mFlags &= ~eHyperTextAccessible;
@@ -1109,17 +1111,18 @@ nsDocAccessible::ARIAAttributeChanged(ns
     }
     return;
   }
 
   // For aria drag and drop changes we fire a generic attribute change event;
   // at least until native API comes up with a more meaningful event.
   if (aAttribute == nsAccessibilityAtoms::aria_grabbed ||
       aAttribute == nsAccessibilityAtoms::aria_dropeffect ||
-      aAttribute == nsAccessibilityAtoms::aria_hidden) {
+      aAttribute == nsAccessibilityAtoms::aria_hidden ||
+      aAttribute == nsAccessibilityAtoms::aria_sort) {
     FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED,
                                aContent);
   }
 
   // We treat aria-expanded as a global ARIA state for historical reasons
   if (aAttribute == nsAccessibilityAtoms::aria_expanded) {
     nsRefPtr<AccEvent> event =
       new AccStateChangeEvent(aContent, states::EXPANDED);
--- a/accessible/src/base/nsDocAccessible.h
+++ b/accessible/src/base/nsDocAccessible.h
@@ -547,9 +547,16 @@ protected:
    */
   nsRefPtr<NotificationController> mNotificationController;
   friend class NotificationController;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsDocAccessible,
                               NS_DOCACCESSIBLE_IMPL_CID)
 
+inline nsDocAccessible*
+nsAccessible::AsDoc()
+{
+  return mFlags & eDocAccessible ?
+    static_cast<nsDocAccessible*>(this) : nsnull;
+}
+
 #endif
--- a/accessible/src/base/nsOuterDocAccessible.cpp
+++ b/accessible/src/base/nsOuterDocAccessible.cpp
@@ -208,18 +208,18 @@ PRBool
 nsOuterDocAccessible::RemoveChild(nsAccessible *aAccessible)
 {
   nsAccessible *child = mChildren.SafeElementAt(0, nsnull);
   if (child != aAccessible) {
     NS_ERROR("Wrong child to remove!");
     return PR_FALSE;
   }
 
-  NS_LOG_ACCDOCDESTROY("remove document from outerdoc",
-                       child->GetDocumentNode())
+  NS_LOG_ACCDOCDESTROY_FOR("remove document from outerdoc",
+                           child->GetDocumentNode(), child)
   NS_LOG_ACCDOCDESTROY_ACCADDRESS("outerdoc", this)
 
   PRBool wasRemoved = nsAccessible::RemoveChild(child);
 
   NS_ASSERTION(!mChildren.Length(),
                "This child document of outerdoc accessible wasn't removed!");
 
   return wasRemoved;
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -292,17 +292,17 @@ nsTextEquivUtils::AppendFromValue(nsAcce
     nsresult rv = aAccessible->GetValue(text);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return AppendString(aString, text) ?
       NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
   }
 
   //XXX: is it necessary to care the accessible is not a document?
-  if (aAccessible->IsDocument())
+  if (aAccessible->IsDocumentNode())
     return NS_ERROR_UNEXPECTED;
 
   nsIContent *content = aAccessible->GetContent();
 
   nsCOMPtr<nsIContent> parent = content->GetParent();
   PRInt32 indexOf = parent->IndexOf(content);
 
   for (PRInt32 i = indexOf - 1; i >= 0; i--) {
--- a/accessible/src/html/nsHTMLTableAccessible.cpp
+++ b/accessible/src/html/nsHTMLTableAccessible.cpp
@@ -44,17 +44,16 @@
 #include "nsAccTreeWalker.h"
 #include "nsAccUtils.h"
 #include "nsDocAccessible.h"
 #include "nsRelUtils.h"
 #include "nsTextEquivUtils.h"
 
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMDocumentRange.h"
 #include "nsIDOMRange.h"
 #include "nsISelection2.h"
 #include "nsISelectionPrivate.h"
 #include "nsINameSpaceManager.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableElement.h"
 #include "nsIDOMHTMLTableRowElement.h"
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -911,17 +911,17 @@ nsresult nsHyperTextAccessible::GetTextH
       // otherwise screen readers will announce the wrong line as the user presses up or down arrow and land
       // at the end of a line.
       nsCOMPtr<nsISelection> domSel;
       nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
                                   nsnull, getter_AddRefs(domSel));
       NS_ENSURE_SUCCESS(rv, rv);
 
       nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
-      nsCOMPtr<nsFrameSelection> frameSelection;
+      nsRefPtr<nsFrameSelection> frameSelection;
       rv = privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
         -- aOffset;  // We are at the start of a line
       }
     }
   }
@@ -1009,17 +1009,17 @@ nsresult nsHyperTextAccessible::GetTextH
   else {
     finalStartOffset = GetRelativeOffset(presShell, startFrame, startOffset,
                                          startAcc, amount, eDirPrevious,
                                          needsStart);
     NS_ENSURE_TRUE(finalStartOffset >= 0, NS_ERROR_FAILURE);
   }
 
   if (aType == eGetBefore) {
-    endOffset = aOffset;
+    finalEndOffset = aOffset;
   }
   else {
     // Start moving forward from the start so that we don't get 
     // 2 words/lines if the offset occurred on whitespace boundary
     // Careful, startOffset and endOffset are passed by reference to GetPosAndText() and changed
     // For BOUNDARY_LINE_END, make sure we start of this line
     startOffset = endOffset = finalStartOffset + (aBoundaryType == BOUNDARY_LINE_END);
     nsRefPtr<nsAccessible> endAcc;
@@ -1675,17 +1675,17 @@ PRInt32 nsHyperTextAccessible::GetCaretL
 {
   // Provide the line number for the caret, relative to the
   // currently focused node. Use a 1-based index
   nsCOMPtr<nsISelection> domSel;
   GetSelections(nsISelectionController::SELECTION_NORMAL, nsnull,
                 getter_AddRefs(domSel));
   nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
   NS_ENSURE_TRUE(privateSelection, -1);
-  nsCOMPtr<nsFrameSelection> frameSelection;
+  nsRefPtr<nsFrameSelection> frameSelection;
   privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
   NS_ENSURE_TRUE(frameSelection, -1);
 
   nsCOMPtr<nsIDOMNode> caretNode;
   domSel->GetFocusNode(getter_AddRefs(caretNode));
   nsCOMPtr<nsIContent> caretContent = do_QueryInterface(caretNode);
   if (!caretContent || !nsCoreUtils::IsAncestorOf(GetNode(), caretContent))
     return -1;
--- a/accessible/src/mac/mozAccessible.mm
+++ b/accessible/src/mac/mozAccessible.mm
@@ -233,25 +233,25 @@ GetNativeFromGeckoAccessible(nsIAccessib
   if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
     return [NSNumber numberWithBool:[self isEnabled]];
   if ([attribute isEqualToString:NSAccessibilityValueAttribute])
     return [self value];
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
   if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
     return NSAccessibilityRoleDescription([self role], nil);
 #endif
-  if ([attribute isEqualToString:kInstanceDescriptionAttribute])
+  if ([attribute isEqualToString: (NSString*) kInstanceDescriptionAttribute])
     return [self customDescription];
   if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
     return [NSNumber numberWithBool:[self isFocused]];
   if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
     return [self size];
   if ([attribute isEqualToString:NSAccessibilityWindowAttribute])
     return [self window];
-  if ([attribute isEqualToString:kTopLevelUIElementAttribute])
+  if ([attribute isEqualToString: (NSString*) kTopLevelUIElementAttribute])
     return [self window];
   if ([attribute isEqualToString:NSAccessibilityTitleAttribute] || 
       [attribute isEqualToString:NSAccessibilityTitleUIElementAttribute])
     return [self title];
   if ([attribute isEqualToString:NSAccessibilityHelpAttribute])
     return [self help];
     
 #ifdef DEBUG
@@ -466,17 +466,17 @@ GetNativeFromGeckoAccessible(nsIAccessib
 }
 
 - (NSString*)role
 {
 #ifdef DEBUG_A11Y
   NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(mGeckoAccessible),
                "Does not support nsIAccessibleText when it should");
 #endif
-  return AXRoles[mRole];
+  return (NSString*) AXRoles[mRole];
 }
 
 - (NSString*)subrole
 {
   return nil;
 }
 
 - (NSString*)title
--- a/accessible/src/mac/nsAccessibleWrap.h
+++ b/accessible/src/mac/nsAccessibleWrap.h
@@ -38,45 +38,46 @@
 
 /* For documentation of the accessibility architecture, 
  * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
  */
 
 #ifndef _nsAccessibleWrap_H_
 #define _nsAccessibleWrap_H_
 
+#include <objc/objc.h>
+
 #include "nsAccessible.h"
 #include "nsAccUtils.h"
 #include "States.h"
 
 #include "nsCOMPtr.h"
 #include "nsRect.h"
 
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 
 struct AccessibleWrapper;
-struct objc_class;
 
 class nsAccessibleWrap : public nsAccessible
 {
   public: // construction, destruction
     nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
     virtual ~nsAccessibleWrap();
     
     // creates the native accessible connected to this one.
     virtual PRBool Init ();
     
     // get the native obj-c object (mozAccessible)
     NS_IMETHOD GetNativeInterface (void **aOutAccessible);
     
     // the objective-c |Class| type that this accessible's native object
     // should be instantied with.   used on runtime to determine the
     // right type for this accessible's associated native object.
-    virtual objc_class* GetNativeType ();
+    virtual Class GetNativeType ();
 
     virtual void Shutdown ();
     virtual void InvalidateChildren();
 
     virtual nsresult HandleAccEvent(AccEvent* aEvent);
 
     // ignored means that the accessible might still have children, but is not displayed
     // to the user. it also has no native accessible object represented for it.
--- a/accessible/src/mac/nsAccessibleWrap.mm
+++ b/accessible/src/mac/nsAccessibleWrap.mm
@@ -83,17 +83,17 @@ nsAccessibleWrap::GetNativeInterface (vo
     *aOutInterface = (void**)mNativeWrapper->getNativeObject();
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
 // overridden in subclasses to create the right kind of object. by default we create a generic
 // 'mozAccessible' node.
-objc_class*
+Class
 nsAccessibleWrap::GetNativeType () 
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   PRUint32 role = Role();
   switch (role) {
     case nsIAccessibleRole::ROLE_PUSHBUTTON:
     case nsIAccessibleRole::ROLE_SPLITBUTTON:
--- a/accessible/src/mac/nsRootAccessibleWrap.h
+++ b/accessible/src/mac/nsRootAccessibleWrap.h
@@ -49,17 +49,17 @@ struct objc_class;
 
 class nsRootAccessibleWrap : public nsRootAccessible
 {
 public:
   nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                        nsIWeakReference *aShell);
   virtual ~nsRootAccessibleWrap();
 
-    objc_class* GetNativeType ();
+    Class GetNativeType ();
     
     // let's our native accessible get in touch with the
     // native cocoa view that is our accessible parent.
     void GetNativeWidget (void **aOutView);
 };
 
 
 #endif
--- a/accessible/src/mac/nsRootAccessibleWrap.mm
+++ b/accessible/src/mac/nsRootAccessibleWrap.mm
@@ -54,17 +54,17 @@ nsRootAccessibleWrap::
   nsRootAccessible(aDocument, aRootContent, aShell)
 {
 }
 
 nsRootAccessibleWrap::~nsRootAccessibleWrap()
 {
 }
 
-objc_class*
+Class
 nsRootAccessibleWrap::GetNativeType ()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   return [mozRootAccessible class];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
--- a/accessible/src/msaa/nsAccessNodeWrap.cpp
+++ b/accessible/src/msaa/nsAccessNodeWrap.cpp
@@ -270,17 +270,17 @@ STDMETHODIMP nsAccessNodeWrap::get_attri
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aAttribNames,
     /* [length_is][size_is][out] */ short __RPC_FAR *aNameSpaceIDs,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aAttribValues,
     /* [out] */ unsigned short __RPC_FAR *aNumAttribs)
 {
 __try{
   *aNumAttribs = 0;
 
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || IsDocumentNode())
     return E_FAIL;
 
   PRUint32 numAttribs = mContent->GetAttrCount();
   if (numAttribs > aMaxAttribs)
     numAttribs = aMaxAttribs;
   *aNumAttribs = static_cast<unsigned short>(numAttribs);
 
   for (PRUint32 index = 0; index < numAttribs; index++) {
@@ -343,17 +343,17 @@ STDMETHODIMP nsAccessNodeWrap::get_compu
     /* [in] */ boolean aUseAlternateView,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleProperties,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues,
     /* [out] */ unsigned short __RPC_FAR *aNumStyleProperties)
 {
 __try{
   *aNumStyleProperties = 0;
 
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || IsDocumentNode())
     return E_FAIL;
 
   nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
     nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), mContent);
   NS_ENSURE_TRUE(cssDecl, E_FAIL);
 
   PRUint32 length;
   cssDecl->GetLength(&length);
@@ -378,17 +378,17 @@ STDMETHODIMP nsAccessNodeWrap::get_compu
 
 STDMETHODIMP nsAccessNodeWrap::get_computedStyleForProperties( 
     /* [in] */ unsigned short aNumStyleProperties,
     /* [in] */ boolean aUseAlternateView,
     /* [length_is][size_is][in] */ BSTR __RPC_FAR *aStyleProperties,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues)
 {
 __try {
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || IsDocumentNode())
     return E_FAIL;
  
   nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
     nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), mContent);
   NS_ENSURE_TRUE(cssDecl, E_FAIL);
 
   PRUint32 index;
   for (index = 0; index < aNumStyleProperties; index ++) {
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -1757,16 +1757,48 @@ nsAccessibleWrap::GetXPAccessibleFor(con
 
   // if its us real easy - this seems to always be the case
   if (aVarChild.lVal == CHILDID_SELF)
     return this;
 
   if (nsAccUtils::MustPrune(this))
     return nsnull;
 
+  // If lVal negative then it is treated as child ID and we should look for
+  // accessible through whole accessible subtree including subdocuments.
+  // Otherwise we treat lVal as index in parent.
+
+  if (aVarChild.lVal < 0) {
+    // Convert child ID to unique ID.
+    void* uniqueID = reinterpret_cast<void*>(-aVarChild.lVal);
+
+    // Document.
+    if (IsDoc())
+      return AsDoc()->GetAccessibleByUniqueIDInSubtree(uniqueID);
+
+    // ARIA document.
+    if (ARIARole() == nsIAccessibleRole::ROLE_DOCUMENT) {
+      nsDocAccessible* document = GetDocAccessible();
+      nsAccessible* child =
+        document->GetAccessibleByUniqueIDInSubtree(uniqueID);
+
+      // Check whether the accessible for the given ID is a child of ARIA
+      // document.
+      nsAccessible* parent = child ? child->GetParent() : nsnull;
+      while (parent && parent != document) {
+        if (parent == this)
+          return child;
+
+        parent = parent->GetParent();
+      }
+    }
+
+    return nsnull;
+  }
+
   // Gecko child indices are 0-based in contrast to indices used in MSAA.
   return GetChildAt(aVarChild.lVal - 1);
 }
 
 void nsAccessibleWrap::UpdateSystemCaret()
 {
   // Move the system caret so that Windows Tablet Edition and tradional ATs with 
   // off-screen model can follow the caret
--- a/accessible/src/msaa/nsAccessibleWrap.h
+++ b/accessible/src/msaa/nsAccessibleWrap.h
@@ -322,17 +322,17 @@ public: // construction, destruction
    * We will use an invisible system caret.
    * Gecko is still responsible for drawing its own caret
    */
   void UpdateSystemCaret();
 
   /**
    * Find an accessible by the given child ID in cached documents.
    */
-  virtual nsAccessible *GetXPAccessibleFor(const VARIANT& aVarChild);
+  nsAccessible* GetXPAccessibleFor(const VARIANT& aVarChild);
 
   NS_IMETHOD GetNativeInterface(void **aOutAccessible);
 
   // NT4 does not have the oleacc that defines these methods. So we define copies here that automatically
   // load the library only if needed.
   static STDMETHODIMP AccessibleObjectFromWindow(HWND hwnd,DWORD dwObjectID,REFIID riid,void **ppvObject);
   static STDMETHODIMP NotifyWinEvent(DWORD event,HWND hwnd,LONG idObjectType,LONG idObject);
 
--- a/accessible/src/msaa/nsDocAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsDocAccessibleWrap.cpp
@@ -94,32 +94,16 @@ STDMETHODIMP nsDocAccessibleWrap::QueryI
 
   if (NULL == *ppv)
     return nsHyperTextAccessibleWrap::QueryInterface(iid, ppv);
     
   (reinterpret_cast<IUnknown*>(*ppv))->AddRef();
   return S_OK;
 }
 
-nsAccessible*
-nsDocAccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
-{
-  // If lVal negative then it is treated as child ID and we should look for
-  // accessible through whole accessible subtree including subdocuments.
-  // Otherwise we treat lVal as index in parent.
-
-  if (aVarChild.vt == VT_I4 && aVarChild.lVal < 0) {
-    // Convert child ID to unique ID.
-    void* uniqueID = reinterpret_cast<void*>(-aVarChild.lVal);
-    return GetAccessibleByUniqueIDInSubtree(uniqueID);
-  }
-
-  return nsAccessibleWrap::GetXPAccessibleFor(aVarChild);
-}
-
 STDMETHODIMP nsDocAccessibleWrap::get_URL(/* [out] */ BSTR __RPC_FAR *aURL)
 {
 __try {
   *aURL = NULL;
 
   nsAutoString URL;
   nsresult rv = GetURL(URL);
   if (NS_FAILED(rv))
--- a/accessible/src/msaa/nsDocAccessibleWrap.h
+++ b/accessible/src/msaa/nsDocAccessibleWrap.h
@@ -87,19 +87,16 @@ public:
     // Override get_accValue to provide URL when no other value is available
     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue( 
         /* [optional][in] */ VARIANT varChild,
         /* [retval][out] */ BSTR __RPC_FAR *pszValue);
 
   // nsAccessNode
   virtual void Shutdown();
 
-  // nsAccessibleWrap
-  virtual nsAccessible *GetXPAccessibleFor(const VARIANT& varChild);
-
   // nsDocAccessible
   virtual void* GetNativeWindow() const;
 
 protected:
   // nsDocAccessible
   virtual void NotifyOfInitialUpdate();
 
 protected:
--- a/accessible/tests/mochitest/events/Makefile.in
+++ b/accessible/tests/mochitest/events/Makefile.in
@@ -46,18 +46,18 @@ include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		docload_wnd.html \
 		docload_wnd.xul \
 		focus.html \
 		scroll.html \
 		test_aria_alert.html \
-		test_aria_hidden.html \
 		test_aria_menu.html \
+		test_aria_objattr.html \
 		test_aria_statechange.html \
 		test_attrs.html \
 		test_caretmove.html \
 		test_caretmove.xul \
 		test_coalescence.html \
 		test_contextmenu.html \
 		test_docload.html \
 		test_docload.xul \
--- a/accessible/tests/mochitest/events/docload_wnd.xul
+++ b/accessible/tests/mochitest/events/docload_wnd.xul
@@ -187,34 +187,34 @@
       {
         return "reload page";
       }
     }
 
     /**
      * Load wrong URI what results in error page loading.
      */
-    function loadErrorPageInvoker()
+    function loadErrorPageInvoker(aURL, aURLDescr)
     {
       this.invoke = function loadErrorPageInvoker_invoke()
       {
-        gTabBrowser.loadURI("www.wronguri.wronguri");
+        gTabBrowser.loadURI(aURL);
       }
 
       this.eventSeq = [
         // We don't expect state change for busy true, load stopped events since
         // things happen quickly and it's coalesced.
         new invokerChecker(EVENT_REORDER, getContainer),
         new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, getDocument),
         new stateBusyChecker(false)
       ];
 
       this.getID = function loadErrorPageInvoker_getID()
       {
-        return "load error page";
+        return "load error page: '" + aURLDescr + "'";
       }
     }
 
     ////////////////////////////////////////////////////////////////////////////
     // Tests
 
     var gQueue = null;
 
@@ -225,17 +225,21 @@
     {
       gTabBrowser = document.getElementById("content");
 
       gQueue = new gOpenerWnd.eventQueue();
       gQueue.push(new loadURIInvoker("about:"));
       gQueue.push(new clickReloadBtnInvoker());
       gQueue.push(new loadURIInvoker("about:mozilla"));
       gQueue.push(new reloadInvoker());
-      gQueue.push(new loadErrorPageInvoker());
+      gQueue.push(new loadErrorPageInvoker("www.wronguri.wronguri",
+                                           "Server not found"));
+      gQueue.push(new loadErrorPageInvoker("https://nocert.example.com:443",
+                                          "Untrusted Connection"));
+
       gQueue.onFinish = function() { window.close(); }
       gQueue.invoke();
     }
 
     gOpenerWnd.addA11yLoadEvent(doTest);
   ]]>
   </script>
 
rename from accessible/tests/mochitest/events/test_aria_hidden.html
rename to accessible/tests/mochitest/events/test_aria_objattr.html
--- a/accessible/tests/mochitest/events/test_aria_hidden.html
+++ b/accessible/tests/mochitest/events/test_aria_objattr.html
@@ -1,12 +1,12 @@
 <html>
 
 <head>
-  <title>Accessible ARIA hidden attribute</title>
+  <title>Accessible ARIA object attribute changes</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>
@@ -38,42 +38,73 @@
       }
 
       this.getID = function hideNode_getID()
       {
         return "aria-hidden for " + aID + " " + bHide;
       }
     }
 
+    function updateSort(aID, aSort)
+    {
+      this.node = getNode(aID);
+      this.accessible = getAccessible(this.node);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
+      ];
+
+      this.invoke = function updateSort_invoke()
+      {
+        this.node.setAttribute("aria-sort", aSort);
+      }
+
+      this.getID = function updateSort_getID()
+      {
+        return "aria-sort for " + aID + " " + aSort;
+      }
+    }
+
+    // Debug stuff.
+    // gA11yEventDumpID = "eventdump";
+    // gA11yEventDumpToConsole = true;
+    
     function doTests()
     {
-      //gA11yEventDumpID = "eventdump"; // debug stuff
-
       gQueue = new eventQueue();
 
       gQueue.push(new hideNode("hideable", "true"));
 
+      gQueue.push(new updateSort("sortable", "ascending"));
+
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 </head>
 
 <body>
 
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=581096"
      title="Add support for aria-hidden">
     Mozilla Bug 581096
   </a>
 
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
+     title="Add event support for aria-sort">
+    Mozilla Bug 640707
+  </a>
+
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
   <div id="eventdump"></div>
 
   <div id="hideable"><div>Hi</div><div>there</div></div>
 
+  <div id="sortable" role="columnheader" aria-sort"none">aria-sort</div>
 </body>
 </html>
--- a/accessible/tests/mochitest/text/Makefile.in
+++ b/accessible/tests/mochitest/text/Makefile.in
@@ -45,15 +45,15 @@ relativesrcdir  = accessible/text
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = \
 		doc.html \
 		test_doc.html \
 		test_hypertext.html \
 		test_passwords.html \
-		$(warning test_singleline.html disabled due to bug 652459) \
-		$(warning test_whitespaces.html disabled due to bug 652459) \
+		test_singleline.html \
+		test_whitespaces.html \
 		test_words.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
--- a/accessible/tests/mochitest/text/test_singleline.html
+++ b/accessible/tests/mochitest/text/test_singleline.html
@@ -211,50 +211,50 @@
       // BOUNDARY_CHAR
       testCharBeforeOffset(IDs, 0, "", 0, 0);
       testCharBeforeOffset(IDs, 1, "h", 0, 1);
       testCharBeforeOffset(IDs, 14, "n", 13, 14);
       testCharBeforeOffset(IDs, 15, "d", 14, 15);
 
       // BOUNDARY_WORD_START
       testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(6, BOUNDARY_WORD_START, "hello ", 0, 6,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(7, BOUNDARY_WORD_START, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(8, BOUNDARY_WORD_START, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(9, BOUNDARY_WORD_START, "my ", 6, 9,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(10, BOUNDARY_WORD_START, "my ", 6, 9,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(14, BOUNDARY_WORD_START, "my ", 6, 9,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
@@ -263,35 +263,35 @@
       testTextBeforeOffset(15, BOUNDARY_WORD_START, "my ", 6, 9,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
 
       // BOUNDARY_WORD_END
       testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(5, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(6, BOUNDARY_WORD_END, "hello ", 0, 6,
-                           "input", kTodo, kTodo, kTodo,
-                           "div", kTodo, kTodo, kTodo,
-                           "editable", kTodo, kTodo, kTodo,
-                           "textarea", kTodo, kTodo, kTodo);
+                           "input", kTodo, kTodo, kOk,
+                           "div", kTodo, kTodo, kOk,
+                           "editable", kTodo, kTodo, kOk,
+                           "textarea", kTodo, kTodo, kOk);
       testTextBeforeOffset(7, BOUNDARY_WORD_END, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(8, BOUNDARY_WORD_END, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
@@ -315,20 +315,20 @@
       testTextBeforeOffset(15, BOUNDARY_WORD_END, " my", 5, 8,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
 
       // BOUNDARY_LINE_START
       testTextBeforeOffset(0, BOUNDARY_LINE_START, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_LINE_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(14, BOUNDARY_LINE_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
@@ -337,20 +337,20 @@
       testTextBeforeOffset(15, BOUNDARY_LINE_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
 
       // BOUNDARY_LINE_END
       testTextBeforeOffset(0, BOUNDARY_LINE_END, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_LINE_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(14, BOUNDARY_LINE_END, "", 0, 0,
                            "input", kOk, kOk, kOk,
                            "div", kOk, kOk, kOk,
--- a/accessible/tests/mochitest/text/test_whitespaces.html
+++ b/accessible/tests/mochitest/text/test_whitespaces.html
@@ -191,50 +191,50 @@
       testCharBeforeOffset(IDs, 6, " ", 5, 6);
       testCharBeforeOffset(IDs, 10, " ", 9, 10);
       testCharBeforeOffset(IDs, 11, " ", 10, 11);
       testCharBeforeOffset(IDs, 17, " ", 16, 17);
       testCharBeforeOffset(IDs, 19, " ", 18, 19);
 
       // BOUNDARY_WORD_START
       testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(6, BOUNDARY_WORD_START, "Brave ", 0, 6,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(9, BOUNDARY_WORD_START, "Brave ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(10, BOUNDARY_WORD_START, "Brave ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(11, BOUNDARY_WORD_START, "Sir  ", 6, 11,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(15, BOUNDARY_WORD_START, "Sir  ", 6, 11,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(16, BOUNDARY_WORD_START, "Sir  ", 6, 11,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
@@ -246,37 +246,37 @@
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(18, BOUNDARY_WORD_START, "Sir  ", 6, 11,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(19, BOUNDARY_WORD_START, "Robin   ", 11, 19,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(20, BOUNDARY_WORD_START, "Robin   ", 11, 19,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(21, BOUNDARY_WORD_START, "Robin   ", 11, 19,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
 
       // BOUNDARY_WORD_END
       testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(4, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -180,18 +180,17 @@ EXTRA_DEPS	+= \
 DEFINES		+= $(STATIC_DEFINES)
 CPPSRCS		+= $(STATIC_CPPSRCS)
 EXTRA_DSO_LIBS	+= $(STATIC_EXTRA_DSO_LIBS)
 EXTRA_LIBS	+= $(STATIC_EXTRA_LIBS)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
-OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32 delayimp)
-LDFLAGS += -delayload:xul.dll -delayload:xpcom.dll -delayload:plc4.dll -delayload:nspr4.dll -delayload:mozalloc.dll
+OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 RCINCLUDE = splash.rc
 ifndef GNU_CC
 RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
 else
 RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -51,17 +51,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsILocalFile.h"
 #include "nsStringGlue.h"
 
 #ifdef XP_WIN
 // we want to use the DLL blocklist if possible
 #define XRE_WANT_DLL_BLOCKLIST
-#define XRE_PRELOAD_XUL
 // we want a wmain entry point
 #include "nsWindowsWMain.cpp"
 #endif
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js
@@ -249,28 +249,25 @@ let TestPilotSetup = {
       { notify: function(timer) {
           self.reloadRemoteExperiments(function() {
             self._notifyUserOfTasks();
 	  });
       }}, this._prefs.getValue(POPUP_REMINDER_INTERVAL, 86400000),
       Ci.nsITimer.TYPE_REPEATING_SLACK);
 
       this.getVersion(function() {
-      // Show first run page (in front window) if newly installed or upgraded.
-        let currVersion = self._prefs.getValue(VERSION_PREF, "firstrun");
-
-        if (currVersion != self.version) {
-          if(!self._isBetaChannel()) {
-            // Don't show first run page in ffx4 beta version.
+        /* Show first run page (in front window) only the first time after install;
+         * Don't show first run page in Feedback UI version. */
+        if ((self._prefs.getValue(VERSION_PREF, "") == "") &&
+           (!self._interfaceBuilder.channelUsesFeedback())) {
             self._prefs.setValue(VERSION_PREF, self.version);
             let browser = self._getFrontBrowserWindow().getBrowser();
             let url = self._prefs.getValue(FIRST_RUN_PREF, "");
             let tab = browser.addTab(url);
             browser.selectedTab = tab;
-          }
         }
 
         // Install tasks. (This requires knowing the version, so it is
         // inside the callback from getVersion.)
         self.checkForTasks(function() {
           /* Callback to complete startup after we finish
            * checking for tasks. */
          self.startupComplete = true;
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -780,16 +780,18 @@ pref("browser.sessionstore.max_windows_u
 // (this pref has no effect if more than 6 hours have passed since the last crash)
 pref("browser.sessionstore.max_resumed_crashes", 1);
 // The number of tabs that can restore concurrently:
 // < 0 = All tabs can restore at the same time
 //   0 = Only the selected tab in each window will be restored
 //       Other tabs won't be restored until they are selected
 //   N = The number of tabs to restore at the same time
 pref("browser.sessionstore.max_concurrent_tabs", 3);
+// Whether to automatically restore hidden tabs (i.e., tabs in other tab groups) or not
+pref("browser.sessionstore.restore_hidden_tabs", false);
 
 // allow META refresh by default
 pref("accessibility.blockautorefresh", false);
 
 // Whether history is enabled or not.
 pref("places.history.enabled", true);
 
 // The percentage of system memory that the Places database can use.  Out of the
@@ -998,16 +1000,29 @@ pref("devtools.scratchpad.enabled", true
 // Enable tools for Chrome development.
 pref("devtools.chrome.enabled", false);
 
 // The last Web Console height. This is initially 0 which means that the Web
 // Console will use the default height next time it shows.
 // Change to -1 if you do not want the Web Console to remember its last height.
 pref("devtools.hud.height", 0);
 
+// Remember the Web Console position. Possible values:
+//   above - above the web page,
+//   below - below the web page,
+//   window - in a separate window/popup panel.
+pref("devtools.webconsole.position", "above");
+
+// The number of lines that are displayed in the web console for the Net,
+// CSS, JS and Web Developer categories.
+pref("devtools.hud.loglimit.network", 200);
+pref("devtools.hud.loglimit.cssparser", 200);
+pref("devtools.hud.loglimit.exception", 200);
+pref("devtools.hud.loglimit.console", 200);
+
 // Whether the character encoding menu is under the main Firefox button. This
 // preference is a string so that localizers can alter it.
 pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
 
 // Allow using tab-modal prompts when possible.
 pref("prompts.tab_modal.enabled", true);
 // Whether the Panorama should animate going in/out of tabs
 pref("browser.panorama.animate_zoom", true);
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -354,17 +354,16 @@ appUpdater.prototype =
      * See nsIUpdateService.idl
      */
     onError: function(aRequest, aUpdate) {
       // Errors in the update check are treated as no updates found. If the
       // update check fails repeatedly without a success the user will be
       // notified with the normal app update user interface so this is safe.
       gAppUpdater.isChecking = false;
       gAppUpdater.selectPanel("noUpdatesFound");
-      return;
     },
 
     /**
      * See nsISupports.idl
      */
     QueryInterface: function(aIID) {
       if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
           !aIID.equals(Components.interfaces.nsISupports))
@@ -608,16 +607,18 @@ var gChannelSelector = {
 
   apply: function() {
     this.channelValue = document.getElementById("channelMenulist").selectedItem.value;
     this.setChannelLabel(this.channelValue);
 
     // Change app update channel.
     Services.prefs.setCharPref("app.update.desiredChannel", this.channelValue);
 
+    // Stop any downloads in progress
+    gAppUpdater.aus.pauseDownload();
     // App updater will look at app.update.desiredChannel for new channel value
     // and will clear it when the update is complete.
     gAppUpdater.isChecking = true;
     gAppUpdater.checker.checkForUpdates(gAppUpdater.updateCheckListener, true);
 
     this.hide();
   },
 
--- a/browser/base/content/browser-tabview.js
+++ b/browser/base/content/browser-tabview.js
@@ -35,51 +35,65 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 let TabView = {
   _deck: null,
   _iframe: null,
   _window: null,
-  _firstUseExperienced: false,
   _browserKeyHandlerInitialized: false,
   _isFrameLoading: false,
   _initFrameCallbacks: [],
+  PREF_BRANCH: "browser.panorama.",
+  PREF_FIRST_RUN: "browser.panorama.experienced_first_run",
+  PREF_STARTUP_PAGE: "browser.startup.page",
+  PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
   VISIBILITY_IDENTIFIER: "tabview-visibility",
 
   // ----------
   get windowTitle() {
     delete this.windowTitle;
     let brandBundle = document.getElementById("bundle_brand");
     let brandShortName = brandBundle.getString("brandShortName");
     let title = gNavigatorBundle.getFormattedString("tabView2.title", [brandShortName]);
     return this.windowTitle = title;
   },
 
   // ----------
   get firstUseExperienced() {
-    return this._firstUseExperienced;
+    let pref = this.PREF_FIRST_RUN;
+    if (Services.prefs.prefHasUserValue(pref))
+      return Services.prefs.getBoolPref(pref);
+
+    return false;
   },
 
   // ----------
   set firstUseExperienced(val) {
-    if (val != this._firstUseExperienced)
-      Services.prefs.setBoolPref("browser.panorama.experienced_first_run", val);
+    Services.prefs.setBoolPref(this.PREF_FIRST_RUN, val);
+  },
+
+  // ----------
+  get sessionRestoreEnabledOnce() {
+    let pref = this.PREF_RESTORE_ENABLED_ONCE;
+    if (Services.prefs.prefHasUserValue(pref))
+      return Services.prefs.getBoolPref(pref);
+
+    return false;
+  },
+
+  // ----------
+  set sessionRestoreEnabledOnce(val) {
+    Services.prefs.setBoolPref(this.PREF_RESTORE_ENABLED_ONCE, val);
   },
 
   // ----------
   init: function TabView_init() {
-    if (!Services.prefs.prefHasUserValue("browser.panorama.experienced_first_run") ||
-        !Services.prefs.getBoolPref("browser.panorama.experienced_first_run")) {
-      Services.prefs.addObserver(
-        "browser.panorama.experienced_first_run", this, false);
-    } else {
-      this._firstUseExperienced = true;
-
+    if (this.firstUseExperienced) {
       if ((gBrowser.tabs.length - gBrowser.visibleTabs.length) > 0)
         this._setBrowserKeyHandlers();
 
       // ___ visibility
       let sessionstore =
         Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
       let data = sessionstore.getWindowValue(window, this.VISIBILITY_IDENTIFIER);
 
@@ -95,36 +109,34 @@ let TabView = {
             self._initFrame(function() {
               self._window.UI.onTabSelect(gBrowser.selectedTab);
             });
         };
         gBrowser.tabContainer.addEventListener(
           "TabShow", this._tabShowEventListener, true);
       }
     }
+
+    Services.prefs.addObserver(this.PREF_BRANCH, this, false);
   },
 
   // ----------
   // Observes topic changes.
   observe: function TabView_observe(subject, topic, data) {
-    if (topic == "nsPref:changed") {
-      Services.prefs.removeObserver(
-        "browser.panorama.experienced_first_run", this);
-      this._firstUseExperienced = true;
+    if (data == this.PREF_FIRST_RUN && this.firstUseExperienced) {
       this._addToolbarButton();
+      this.enableSessionRestore();
     }
   },
 
   // ----------
   // Uninitializes TabView.
   uninit: function TabView_uninit() {
-    if (!this._firstUseExperienced) {
-      Services.prefs.removeObserver(
-        "browser.panorama.experienced_first_run", this);
-    }
+    Services.prefs.removeObserver(this.PREF_BRANCH, this);
+
     if (this._tabShowEventListener) {
       gBrowser.tabContainer.removeEventListener(
         "TabShow", this._tabShowEventListener, true);
     }
   },
 
   // ----------
   // Creates the frame and calls the callback once it's loaded. 
@@ -361,10 +373,28 @@ let TabView = {
     if (-1 == alltabsPos)
       return;
 
     currentSet[alltabsPos] += "," + buttonId;
     currentSet = currentSet.join(",");
     toolbar.currentSet = currentSet;
     toolbar.setAttribute("currentset", currentSet);
     document.persist(toolbar.id, "currentset");
+  },
+
+  // ----------
+  // Function: enableSessionRestore
+  // Enables automatic session restore when the browser is started. Does
+  // nothing if we already did that once in the past.
+  enableSessionRestore: function UI_enableSessionRestore() {
+    if (!this._window || !this.firstUseExperienced)
+      return;
+
+    // do nothing if we already enabled session restore once
+    if (this.sessionRestoreEnabledOnce)
+      return;
+
+    this.sessionRestoreEnabledOnce = true;
+
+    // enable session restore
+    Services.prefs.setIntPref(this.PREF_STARTUP_PAGE, 3);
   }
 };
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -457,17 +457,16 @@ browser[tabmodalPromptShowing] {
 /* Status panel */
 
 statuspanel {
   -moz-binding: url("chrome://browser/content/tabbrowser.xml#statuspanel");
   position: fixed;
   margin-top: -3em;
   left: 0;
   max-width: 50%;
-  -moz-transition: opacity 100ms ease-out;
 }
 
 statuspanel:-moz-locale-dir(ltr)[mirror],
 statuspanel:-moz-locale-dir(rtl):not([mirror]) {
   left: auto;
   right: 0;
 }
 
@@ -477,16 +476,17 @@ statuspanel[type=status] {
 
 @media all and (max-width: 800px) {
   statuspanel[type=status] {
     min-width: 33%;
   }
 }
 
 statuspanel[type=overLink] {
+  -moz-transition: opacity 100ms ease-out;
   direction: ltr;
 }
 
 statuspanel[label=""] {
   -moz-transition: none;
   opacity: 0;
   pointer-events: none;
 }
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -301,32 +301,38 @@ function SetClickAndHoldHandlers() {
 
   function _addClickAndHoldListenersOnElement(aElm) {
     aElm.addEventListener("mousedown", mousedownHandler, true);
     aElm.addEventListener("mouseup", stopTimer, false);
     aElm.addEventListener("mouseout", stopTimer, false);
     aElm.addEventListener("click", clickHandler, true);
   }
 
-  // Bug 414797: Clone the dropmarker's menu into both the back and
-  // the forward buttons.
+  // Bug 414797: Clone unified-back-forward-button's context menu into both the
+  // back and the forward buttons.
   var unifiedButton = document.getElementById("unified-back-forward-button");
   if (unifiedButton && !unifiedButton._clickHandlersAttached) {
-    var popup = document.getElementById("backForwardMenu").cloneNode(true);
+    unifiedButton._clickHandlersAttached = true;
+
+    let popup = document.getElementById("backForwardMenu").cloneNode(true);
     popup.removeAttribute("id");
-    var backButton = document.getElementById("back-button");
+    // Prevent the context attribute on unified-back-forward-button from being
+    // inherited.
+    popup.setAttribute("context", "");
+
+    let backButton = document.getElementById("back-button");
     backButton.setAttribute("type", "menu");
     backButton.appendChild(popup);
     _addClickAndHoldListenersOnElement(backButton);
-    var forwardButton = document.getElementById("forward-button");
+
+    let forwardButton = document.getElementById("forward-button");
     popup = popup.cloneNode(true);
     forwardButton.setAttribute("type", "menu");
     forwardButton.appendChild(popup);
     _addClickAndHoldListenersOnElement(forwardButton);
-    unifiedButton._clickHandlersAttached = true;
   }
 }
 
 const gSessionHistoryObserver = {
   observe: function(subject, topic, data)
   {
     if (topic != "browser:purge-session-history")
       return;
@@ -1374,17 +1380,17 @@ function prepareForStartup() {
   gBrowser.addEventListener("PluginNotFound",     gPluginHandler, true);
   gBrowser.addEventListener("PluginCrashed",      gPluginHandler, true);
   gBrowser.addEventListener("PluginBlocklisted",  gPluginHandler, true);
   gBrowser.addEventListener("PluginOutdated",     gPluginHandler, true);
   gBrowser.addEventListener("PluginDisabled",     gPluginHandler, true);
   gBrowser.addEventListener("NewPluginInstalled", gPluginHandler.newPluginInstalled, true);
 #ifdef XP_MACOSX
   gBrowser.addEventListener("npapi-carbon-event-model-failure", gPluginHandler, true);
-#endif 
+#endif
 
   Services.obs.addObserver(gPluginHandler.pluginCrashed, "plugin-crashed", false);
 
   window.addEventListener("AppCommand", HandleAppCommandEvent, true);
 
   var webNavigation;
   try {
     webNavigation = getWebNavigation();
@@ -4113,17 +4119,17 @@ var XULBrowserWindow = {
   status: "",
   defaultStatus: "",
   jsStatus: "",
   jsDefaultStatus: "",
   overLink: "",
   startTime: 0,
   statusText: "",
   isBusy: false,
-  inContentWhitelist: ["about:addons"],
+  inContentWhitelist: ["about:addons", "about:permissions"],
 
   QueryInterface: function (aIID) {
     if (aIID.equals(Ci.nsIWebProgressListener) ||
         aIID.equals(Ci.nsIWebProgressListener2) ||
         aIID.equals(Ci.nsISupportsWeakReference) ||
         aIID.equals(Ci.nsIXULBrowserWindow) ||
         aIID.equals(Ci.nsISupports))
       return this;
@@ -6687,56 +6693,65 @@ var gPluginHandler = {
                                 }
                               },
                               true);
   },
 
   handleEvent : function(event) {
     let self = gPluginHandler;
     let plugin = event.target;
-    let hideBarPrefName;
+    let doc = plugin.ownerDocument;
 
     // We're expecting the target to be a plugin.
     if (!(plugin instanceof Ci.nsIObjectLoadingContent))
       return;
 
+    // Force a style flush, so that we ensure our binding is attached.
+    plugin.clientTop;
+
     switch (event.type) {
       case "PluginCrashed":
         self.pluginInstanceCrashed(plugin, event);
         break;
 
       case "PluginNotFound":
         // For non-object plugin tags, register a click handler to install the
         // plugin. Object tags can, and often do, deal with that themselves,
         // so don't stomp on the page developers toes.
-        if (!(plugin instanceof HTMLObjectElement))
-          self.addLinkClickCallback(plugin, "installSinglePlugin");
+        if (!(plugin instanceof HTMLObjectElement)) {
+          // We don't yet check to see if there's actually an installer available.
+          let installStatus = doc.getAnonymousElementByAttribute(plugin, "class", "installStatus");
+          installStatus.setAttribute("status", "ready");
+          let iconStatus = doc.getAnonymousElementByAttribute(plugin, "class", "icon");
+          iconStatus.setAttribute("status", "ready");
+
+          let installLink = doc.getAnonymousElementByAttribute(plugin, "class", "installPluginLink");
+          self.addLinkClickCallback(installLink, "installSinglePlugin", plugin);
+        }
         /* FALLTHRU */
+
       case "PluginBlocklisted":
       case "PluginOutdated":
-        hideBarPrefName = event.type == "PluginOutdated" ?
-                                "plugins.hide_infobar_for_outdated_plugin" :
-                                "plugins.hide_infobar_for_missing_plugin";
-        if (gPrefService.getBoolPref(hideBarPrefName))
-          return;
-
+#ifdef XP_MACOSX
+      case "npapi-carbon-event-model-failure":
+#endif
         self.pluginUnavailable(plugin, event.type);
         break;
-#ifdef XP_MACOSX
-      case "npapi-carbon-event-model-failure":
-        hideBarPrefName = "plugins.hide_infobar_for_carbon_failure_plugin";
-        if (gPrefService.getBoolPref(hideBarPrefName))
-          return;
-
-        self.pluginUnavailable(plugin, event.type);
+
+      case "PluginDisabled":
+        let manageLink = doc.getAnonymousElementByAttribute(plugin, "class", "managePluginsLink");
+        self.addLinkClickCallback(manageLink, "managePlugins");
         break;
-#endif
-      case "PluginDisabled":
-        self.addLinkClickCallback(plugin, "managePlugins");
-        break;
+    }
+
+    // Hide the in-content UI if it's too big. The crashed plugin handler already did this.
+    if (event.type != "PluginCrashed") {
+      let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
+      if (self.isTooSmall(plugin, overlay))
+          overlay.style.visibility = "hidden";
     }
   },
 
   newPluginInstalled : function(event) {
     // browser elements are anonymous so we can't just use target.
     var browser = event.originalTarget;
     // clear the plugin list, now that at least one plugin has been installed
     browser.missingPlugins = null;
@@ -6746,20 +6761,20 @@ var gPluginHandler = {
     if (notification)
       notificationBox.removeNotification(notification);
 
     // reload the browser to make the new plugin show.
     browser.reload();
   },
 
   // Callback for user clicking on a missing (unsupported) plugin.
-  installSinglePlugin: function (aEvent) {
+  installSinglePlugin: function (plugin) {
     var missingPluginsArray = {};
 
-    var pluginInfo = getPluginInfo(aEvent.target);
+    var pluginInfo = getPluginInfo(plugin);
     missingPluginsArray[pluginInfo.mimetype] = pluginInfo;
 
     openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
                "PFSWindow", "chrome,centerscreen,resizable=yes",
                {plugins: missingPluginsArray, browser: gBrowser.selectedBrowser});
   },
 
   // Callback for user clicking on a disabled plugin
@@ -6799,19 +6814,16 @@ var gPluginHandler = {
     var notificationBox = gBrowser.getNotificationBox(browser);
 
     // Should only display one of these warnings per page.
     // In order of priority, they are: outdated > missing > blocklisted
     let outdatedNotification = notificationBox.getNotificationWithValue("outdated-plugins");
     let blockedNotification  = notificationBox.getNotificationWithValue("blocked-plugins");
     let missingNotification  = notificationBox.getNotificationWithValue("missing-plugins");
 
-    // If there is already an outdated plugin notification then do nothing
-    if (outdatedNotification)
-      return;
 
     function showBlocklistInfo() {
       var url = formatURL("extensions.blocklist.detailsURL", true);
       gBrowser.loadOneTab(url, {inBackground: false});
       return true;
     }
 
     function showOutdatedPluginsInfo() {
@@ -6833,17 +6845,17 @@ var gPluginHandler = {
 
 #ifdef XP_MACOSX
     function carbonFailurePluginsRestartBrowser()
     {
       // Notify all windows that an application quit has been requested.
       let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
                          createInstance(Ci.nsISupportsPRBool);
       Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
- 
+
       // Something aborted the quit process.
       if (cancelQuit.data)
         return;
 
       let as = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
       as.quit(Ci.nsIAppStartup.eRestarti386 | Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
     }
 #endif
@@ -6897,43 +6909,60 @@ var gPluginHandler = {
                                                          label     : gNavigatorBundle.getString("carbonFailurePluginsMessage.restartButton.label"),
                                                          accessKey : gNavigatorBundle.getString("carbonFailurePluginsMessage.restartButton.accesskey"),
                                                          popup     : null,
                                                          callback  : carbonFailurePluginsRestartBrowser
                                                       }],
                             }
 #endif
     };
+
+    // If there is already an outdated plugin notification then do nothing
+    if (outdatedNotification)
+      return;
+
 #ifdef XP_MACOSX
     if (eventType == "npapi-carbon-event-model-failure") {
-
-      let carbonFailureNotification = 
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_carbon_failure_plugin"))
+        return;
+
+      let carbonFailureNotification =
         notificationBox.getNotificationWithValue("carbon-failure-plugins");
 
       if (carbonFailureNotification)
          carbonFailureNotification.close();
 
       let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
       // if this is not a Universal build, just follow PluginNotFound path
       if (!macutils.isUniversalBinary)
         eventType = "PluginNotFound";
     }
 #endif
+
     if (eventType == "PluginBlocklisted") {
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin")) // XXX add a new pref?
+        return;
+
       if (blockedNotification || missingNotification)
         return;
     }
     else if (eventType == "PluginOutdated") {
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_outdated_plugin"))
+        return;
+
       // Cancel any notification about blocklisting/missing plugins
       if (blockedNotification)
         blockedNotification.close();
       if (missingNotification)
         missingNotification.close();
     }
     else if (eventType == "PluginNotFound") {
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin"))
+        return;
+
       if (missingNotification)
         return;
 
       // Cancel any notification about blocklisting plugins
       if (blockedNotification)
         blockedNotification.close();
     }
 
@@ -6979,32 +7008,23 @@ var gPluginHandler = {
     let pluginName      = aEvent.getData("pluginName");
     let pluginFilename  = aEvent.getData("pluginFilename");
     let pluginDumpID    = aEvent.getData("pluginDumpID");
     let browserDumpID   = aEvent.getData("browserDumpID");
 
     // Remap the plugin name to a more user-presentable form.
     pluginName = this.makeNicePluginName(pluginName, pluginFilename);
 
-    // Force a style flush, so that we ensure our binding is attached.
-    plugin.clientTop;
-
     let messageString = gNavigatorBundle.getFormattedString("crashedpluginsMessage.title", [pluginName]);
 
     //
     // Configure the crashed-plugin placeholder.
     //
     let doc = plugin.ownerDocument;
     let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
-
-    // The binding has role="link" here, since missing/disabled/blocked
-    // plugin UI has a onclick handler on the whole thing. This isn't needed
-    // for the plugin-crashed UI, because we use actual HTML links in the text.
-    overlay.removeAttribute("role");
-
     let statusDiv = doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
 #ifdef MOZ_CRASHREPORTER
     let status;
 
     // Determine which message to show regarding crash reports.
     if (submittedReport) { // submitReports && !doPrompt, handled in observer
       status = "submitted";
     }
@@ -8483,26 +8503,31 @@ function restoreLastSession() {
   ss.restoreLastSession();
 }
 
 var TabContextMenu = {
   contextTab: null,
   updateContextMenu: function updateContextMenu(aPopupMenu) {
     this.contextTab = document.popupNode.localName == "tab" ?
                       document.popupNode : gBrowser.selectedTab;
-    let disabled = gBrowser.visibleTabs.length == 1;
+    let disabled = gBrowser.tabs.length == 1;
 
     // Enable the "Close Tab" menuitem when the window doesn't close with the last tab.
     document.getElementById("context_closeTab").disabled =
       disabled && gBrowser.tabContainer._closeWindowWithLastTab;
 
     var menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple");
     for (var i = 0; i < menuItems.length; i++)
       menuItems[i].disabled = disabled;
 
+    disabled = gBrowser.visibleTabs.length == 1;
+    menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple-visible");
+    for (var i = 0; i < menuItems.length; i++)
+      menuItems[i].disabled = disabled;
+
     // Session store
     document.getElementById("context_undoCloseTab").disabled =
       Cc["@mozilla.org/browser/sessionstore;1"].
       getService(Ci.nsISessionStore).
       getClosedTabCount(window) == 0;
 
     // Only one of pin/unpin should be visible
     document.getElementById("context_pinTab").hidden = this.contextTab.pinned;
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -134,17 +134,17 @@
         </menupopup>
       </menu>
       <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
                 accesskey="&moveToNewWindow.accesskey;"
                 tbattr="tabbrowser-multiple"
                 oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
       <menuseparator/>
       <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
-                tbattr="tabbrowser-multiple"
+                tbattr="tabbrowser-multiple-visible"
                 oncommand="gBrowser.reloadAllTabs();"/>
       <menuitem id="context_bookmarkAllTabs"
                 label="&bookmarkAllTabs.label;"
                 accesskey="&bookmarkAllTabs.accesskey;"
                 command="Browser:BookmarkAllTabs"/>
       <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
                 oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
       <menuseparator/>
@@ -839,19 +839,18 @@
                      removable="true">
         <menupopup id="alltabs-popup"
                    position="after_end">
           <menuitem id="menu_tabview"
                     class="menuitem-iconic"
                     key="key_tabview"
                     label="&viewTabGroups.label;"
                     command="Browser:ToggleTabView"
-                    observes="tabviewGroupsNumber"
-                    keepme="true"/>
-          <menuseparator id="alltabs-popup-separator" keepme="true"/>
+                    observes="tabviewGroupsNumber"/>
+          <menuseparator id="alltabs-popup-separator"/>
         </menupopup>
       </toolbarbutton>
 
       <toolbarbutton id="tabs-closebutton"
                      class="close-button tabs-closebutton"
                      command="cmd_close"
                      label="&closeTab.label;"
                      tooltiptext="&closeTab.label;"/>
--- a/browser/base/content/scratchpad.js
+++ b/browser/base/content/scratchpad.js
@@ -53,34 +53,34 @@ const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource:///modules/PropertyPanel.jsm");
 
 const SCRATCHPAD_CONTEXT_CONTENT = 1;
-const SCRATCHPAD_CONTEXT_CHROME = 2;
+const SCRATCHPAD_CONTEXT_BROWSER = 2;
 const SCRATCHPAD_WINDOW_URL = "chrome://browser/content/scratchpad.xul";
 const SCRATCHPAD_L10N = "chrome://browser/locale/scratchpad.properties";
 const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
 const DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
 
 /**
  * The scratchpad object handles the Scratchpad window functionality.
  */
 var Scratchpad = {
   /**
    * The script execution context. This tells Scratchpad in which context the
    * script shall execute.
    *
    * Possible values:
    *   - SCRATCHPAD_CONTEXT_CONTENT to execute code in the context of the current
    *   tab content window object.
-   *   - SCRATCHPAD_CONTEXT_CHROME to execute code in the context of the
+   *   - SCRATCHPAD_CONTEXT_BROWSER to execute code in the context of the
    *   currently active chrome window object.
    */
   executionContext: SCRATCHPAD_CONTEXT_CONTENT,
 
   /**
    * Retrieve the xul:textbox DOM element. This element holds the source code
    * the user writes and executes.
    */
@@ -116,42 +116,52 @@ var Scratchpad = {
    * Get the gBrowser object of the most recent browser window.
    */
   get gBrowser()
   {
     let recentWin = this.browserWindow;
     return recentWin ? recentWin.gBrowser : null;
   },
 
+  insertIntro: function SP_insertIntro()
+  {
+    this.textbox.value = this.strings.GetStringFromName("scratchpadIntro");
+  },
+
   /**
    * Cached Cu.Sandbox object for the active tab content window object.
    */
   _contentSandbox: null,
 
   /**
    * Get the Cu.Sandbox object for the active tab content window object. Note
    * that the returned object is cached for later reuse. The cached object is
-   * kept only for the current browser window and it is reset for each context
-   * switch or navigator:browser window switch.
+   * kept only for the current location in the current tab of the current
+   * browser window and it is reset for each context switch,
+   * navigator:browser window switch, tab switch or navigation.
    */
   get contentSandbox()
   {
     if (!this.browserWindow) {
       Cu.reportError(this.strings.
                      GetStringFromName("browserWindow.unavailable"));
       return;
     }
 
     if (!this._contentSandbox ||
-        this.browserWindow != this._previousBrowserWindow) {
+        this.browserWindow != this._previousBrowserWindow ||
+        this._previousBrowser != this.gBrowser.selectedBrowser ||
+        this._previousLocation != this.gBrowser.contentWindow.location.href) {
       let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
       this._contentSandbox = new Cu.Sandbox(contentWindow,
         { sandboxPrototype: contentWindow, wantXrays: false });
 
       this._previousBrowserWindow = this.browserWindow;
+      this._previousBrowser = this.gBrowser.selectedBrowser;
+      this._previousLocation = contentWindow.location.href;
     }
 
     return this._contentSandbox;
   },
 
   /**
    * Cached Cu.Sandbox object for the most recently active navigator:browser
    * chrome window object.
@@ -278,53 +288,53 @@ var Scratchpad = {
            this.evalInContentSandbox(aString) :
            this.evalInChromeSandbox(aString);
   },
 
   /**
    * Execute the selected text (if any) or the entire textbox content in the
    * current context.
    */
-  execute: function SP_execute()
+  run: function SP_run()
   {
     let selection = this.selectedText || this.textbox.value;
     let result = this.evalForContext(selection);
     this.deselect();
     return [selection, result];
   },
 
   /**
    * Execute the selected text (if any) or the entire textbox content in the
    * current context. The resulting object is opened up in the Property Panel
    * for inspection.
    */
   inspect: function SP_inspect()
   {
-    let [selection, result] = this.execute();
+    let [selection, result] = this.run();
 
     if (result) {
       this.openPropertyPanel(selection, result);
     }
   },
 
   /**
    * Execute the selected text (if any) or the entire textbox content in the
-   * current context. The evaluation result is "printed" in the textbox after
+   * current context. The evaluation result is inserted into the textbox after
    * the selected text, or at the end of the textbox value if there is no
    * selected text.
    */
-  print: function SP_print()
+  display: function SP_display()
   {
     let selectionStart = this.textbox.selectionStart;
     let selectionEnd = this.textbox.selectionEnd;
     if (selectionStart == selectionEnd) {
       selectionEnd = this.textbox.value.length;
     }
 
-    let [selection, result] = this.execute();
+    let [selection, result] = this.run();
     if (!result) {
       return;
     }
 
     let firstPiece = this.textbox.value.slice(0, selectionEnd);
     let lastPiece = this.textbox.value.
                     slice(selectionEnd, this.textbox.value.length);
 
@@ -551,44 +561,46 @@ var Scratchpad = {
   },
 
   /**
    * Set the current execution context to be the active tab content window.
    */
   setContentContext: function SP_setContentContext()
   {
     let content = document.getElementById("sp-menu-content");
-    document.getElementById("sp-menu-chrome").removeAttribute("checked");
+    document.getElementById("sp-menu-browser").removeAttribute("checked");
     content.setAttribute("checked", true);
+    this.executionContext = SCRATCHPAD_CONTEXT_CONTENT;
     this.statusbarStatus.label = content.getAttribute("label");
-    this.executionContext = SCRATCHPAD_CONTEXT_CONTENT;
     this.resetContext();
   },
 
   /**
    * Set the current execution context to be the most recent chrome window.
    */
-  setChromeContext: function SP_setChromeContext()
+  setBrowserContext: function SP_setBrowserContext()
   {
-    let chrome = document.getElementById("sp-menu-chrome");
+    let browser = document.getElementById("sp-menu-browser");
     document.getElementById("sp-menu-content").removeAttribute("checked");
-    chrome.setAttribute("checked", true);
-    this.statusbarStatus.label = chrome.getAttribute("label");
-    this.executionContext = SCRATCHPAD_CONTEXT_CHROME;
+    browser.setAttribute("checked", true);
+    this.executionContext = SCRATCHPAD_CONTEXT_BROWSER;
+    this.statusbarStatus.label = browser.getAttribute("label");
     this.resetContext();
   },
 
   /**
    * Reset the cached Cu.Sandbox object for the current context.
    */
   resetContext: function SP_resetContext()
   {
     this._chromeSandbox = null;
     this._contentSandbox = null;
     this._previousWindow = null;
+    this._previousBrowser = null;
+    this._previousLocation = null;
   },
 
   /**
    * Gets the ID of the outer window of the given DOM window object.
    *
    * @param nsIDOMWindow aWindow
    * @return integer
    *         the outer window ID
@@ -599,28 +611,29 @@ var Scratchpad = {
            getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
   },
 
   /**
    * The Scratchpad window DOMContentLoaded event handler.
    */
   onLoad: function SP_onLoad()
   {
-    let chromeContextMenu = document.getElementById("sp-menu-chrome");
+    let chromeContextMenu = document.getElementById("sp-menu-browser");
     let errorConsoleMenu = document.getElementById("sp-menu-errorConsole");
     let errorConsoleCommand = document.getElementById("sp-cmd-errorConsole");
-    let chromeContextCommand = document.getElementById("sp-cmd-chromeContext");
+    let chromeContextCommand = document.getElementById("sp-cmd-browserContext");
 
     let chrome = Services.prefs.getBoolPref(DEVTOOLS_CHROME_ENABLED);
     if (chrome) {
       chromeContextMenu.removeAttribute("hidden");
       errorConsoleMenu.removeAttribute("hidden");
       errorConsoleCommand.removeAttribute("disabled");
       chromeContextCommand.removeAttribute("disabled");
     }
+    this.insertIntro();
   },
 };
 
 XPCOMUtils.defineLazyGetter(Scratchpad, "strings", function () {
   return Services.strings.createBundle(SCRATCHPAD_L10N);
 });
 
 addEventListener("DOMContentLoaded", Scratchpad.onLoad.bind(Scratchpad), false);
--- a/browser/base/content/scratchpad.xul
+++ b/browser/base/content/scratchpad.xul
@@ -65,21 +65,21 @@
   <command id="sp-cmd-save" oncommand="Scratchpad.saveFile();"/>
   <command id="sp-cmd-saveas" oncommand="Scratchpad.saveFileAs();"/>
 
   <!-- TODO: bug 650340 - implement printFile()
   <command id="sp-cmd-printFile" oncommand="Scratchpad.printFile();" disabled="true"/>
  -->
 
   <command id="sp-cmd-close" oncommand="window.close();"/>
-  <command id="sp-cmd-execute" oncommand="Scratchpad.execute();"/>
+  <command id="sp-cmd-run" oncommand="Scratchpad.run();"/>
   <command id="sp-cmd-inspect" oncommand="Scratchpad.inspect();"/>
-  <command id="sp-cmd-print" oncommand="Scratchpad.print();"/>
+  <command id="sp-cmd-display" oncommand="Scratchpad.display();"/>
   <command id="sp-cmd-contentContext" oncommand="Scratchpad.setContentContext();"/>
-  <command id="sp-cmd-chromeContext" oncommand="Scratchpad.setChromeContext();" disabled="true"/>
+  <command id="sp-cmd-browserContext" oncommand="Scratchpad.setBrowserContext();" disabled="true"/>
   <command id="sp-cmd-resetContext" oncommand="Scratchpad.resetContext();"/>
   <command id="sp-cmd-errorConsole" oncommand="Scratchpad.openErrorConsole();" disabled="true"/>
   <command id="sp-cmd-webConsole" oncommand="Scratchpad.openWebConsole();"/>
 </commandset>
 
 <keyset id="sp-keyset">
   <key id="sp-key-window"
        key="&newWindowCmd.commandkey;"
@@ -113,27 +113,27 @@
        key="&copyCmd.key;"
        modifiers="accel"/>
   <key id="key_paste"
        key="&pasteCmd.key;"
        modifiers="accel"/>
   <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
   <key id="key_undo" key="&undoCmd.key;" modifiers="accel"/>
   <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
-  <key id="sp-key-execute"
-       key="&execute.key;"
-       command="sp-cmd-execute"
+  <key id="sp-key-run"
+       key="&run.key;"
+       command="sp-cmd-run"
        modifiers="accel"/>
   <key id="sp-key-inspect"
        key="&inspect.key;"
        command="sp-cmd-inspect"
        modifiers="accel"/>
-  <key id="sp-key-print"
-       key="&print.key;"
-       command="sp-cmd-print"
+  <key id="sp-key-display"
+       key="&display.key;"
+       command="sp-cmd-display"
        modifiers="accel"/>
   <key id="sp-key-errorConsole"
        key="&errorConsoleCmd.commandkey;"
        command="sp-cmd-errorConsole"
        modifiers="accel,shift"/>
   <key id="sp-key-webConsole"
        key="&webConsoleCmd.commandkey;"
        command="sp-cmd-webConsole"
@@ -215,17 +215,16 @@
                 accesskey="&pasteCmd.accesskey;"
                 command="cmd_paste"/>
       <menuseparator/>
       <menuitem id="sp-menu-selectAll"
                 label="&selectAllCmd.label;"
                 key="key_selectAll"
                 accesskey="&selectAllCmd.accesskey;"
                 command="cmd_selectAll"/>
-      <menuseparator/>
 
       <!-- TODO: bug 650345 - implement search and replace
       <menuitem id="sp-menu-find"
                 label="&findOnCmd.label;"
                 accesskey="&findOnCmd.accesskey;"
                 key="key_find"
                 disabled="true"
                 command="cmd_find"/>
@@ -233,48 +232,54 @@
                 label="&findAgainCmd.label;"
                 accesskey="&findAgainCmd.accesskey;"
                 key="key_findAgain"
                 disabled="true"
                 command="cmd_findAgain"/>
       <menuseparator id="sp-execute-separator"/>
       -->
 
-      <menuitem id="sp-text-execute"
-                label="&execute.label;"
-                accesskey="&execute.accesskey;"
-                key="sp-key-execute"
-                command="sp-cmd-execute"/>
+    </menupopup>
+  </menu>
+
+  <menu id="sp-execute-menu" label="&executeMenu.label;"
+        accesskey="&executeMenu.accesskey;">
+    <menupopup id="sp-menu_executepopup">
+      <menuitem id="sp-text-run"
+                label="&run.label;"
+                accesskey="&run.accesskey;"
+                key="sp-key-run"
+                command="sp-cmd-run"/>
       <menuitem id="sp-text-inspect"
                 label="&inspect.label;"
                 accesskey="&inspect.accesskey;"
                 key="sp-key-inspect"
                 command="sp-cmd-inspect"/>
-      <menuitem id="sp-text-print"
-                label="&print.label;"
-                accesskey="&print.accesskey;"
-                key="sp-key-print"
-                command="sp-cmd-print"/>
+      <menuitem id="sp-text-display"
+                label="&display.label;"
+                accesskey="&display.accesskey;"
+                key="sp-key-display"
+                command="sp-cmd-display"/>
     </menupopup>
   </menu>
 
-  <menu id="sp-context-menu"
-        label="&contextMenu.label;"
-        accesskey="&contextMenu.accesskey;">
-    <menupopup id="sp-menu-context">
+  <menu id="sp-environment-menu"
+        label="&environmentMenu.label;"
+        accesskey="&environmentMenu.accesskey;">
+    <menupopup id="sp-menu-environment">
       <menuitem id="sp-menu-content"
                 label="&contentContext.label;"
                 accesskey="&contentContext.accesskey;"
                 command="sp-cmd-contentContext"
                 checked="true"
                 type="radio"/>
-      <menuitem id="sp-menu-chrome" hidden="true"
-                command="sp-cmd-chromeContext"
-                label="&chromeContext.label;"
-                accesskey="&chromeContext.accesskey;"
+      <menuitem id="sp-menu-browser" hidden="true"
+                command="sp-cmd-browserContext"
+                label="&browserContext.label;"
+                accesskey="&browserContext.accesskey;"
                 type="radio"/>
       <menuseparator/>
       <menuitem id="sp-menu-resetContext"
                 command="sp-cmd-resetContext"
                 label="&resetContext.label;"
                 accesskey="&resetContext.accesskey;"/>
     </menupopup>
   </menu>
@@ -301,38 +306,38 @@
   <menupopup id="scratchpad-text-popup">
     <menuitem id="menu_cut"/>
     <menuitem id="menu_copy"/>
     <menuitem id="menu_paste"/>
     <menuitem id="menu_delete"/>
     <menuseparator/>
     <menuitem id="menu_selectAll"/>
     <menuseparator/>
-    <menuitem id="sp-text-execute"
-              label="&execute.label;"
-              accesskey="&execute.accesskey;"
-              key="sp-key-execute"
-              command="sp-cmd-execute"/>
+    <menuitem id="sp-text-run"
+              label="&run.label;"
+              accesskey="&run.accesskey;"
+              key="sp-key-run"
+              command="sp-cmd-run"/>
     <menuitem id="sp-text-inspect"
               label="&inspect.label;"
               accesskey="&inspect.accesskey;"
               key="sp-key-inspect"
               command="sp-cmd-inspect"/>
-    <menuitem id="sp-text-print"
-              label="&print.label;"
-              accesskey="&print.accesskey;"
-              key="sp-key-print"
-              command="sp-cmd-print"/>
+    <menuitem id="sp-text-display"
+              label="&display.label;"
+              accesskey="&display.accesskey;"
+              key="sp-key-display"
+              command="sp-cmd-display"/>
   </menupopup>
 </popupset>
 
 <textbox id="scratchpad-textbox"
          multiline="true"
          flex="1"
          context="scratchpad-text-popup"
-         placeholder="&textbox.placeholder;" />
+         placeholder="&textbox.placeholder1;" />
 <statusbar id="scratchpad-statusbar" align="end">
   <statusbarpanel id="scratchpad-status"
                   label="&contentContext.label;"
                   class="statusbarpanel-iconic-text"/>
   <spacer flex="1"/>
 </statusbar>
 </window>
--- a/browser/base/content/syncSetup.js
+++ b/browser/base/content/syncSetup.js
@@ -87,19 +87,19 @@ var gSyncSetup = {
     if (this._settingUpNew)
       return document.getElementById("server").selectedIndex == 0;
     return document.getElementById("existingServer").selectedIndex == 0;
   },
 
   init: function () {
     let obs = [
       ["weave:service:changepph:finish", "onResetPassphrase"],
-      ["weave:service:verify-login:start",  "onLoginStart"],
-      ["weave:service:verify-login:error",  "onLoginEnd"],
-      ["weave:service:verify-login:finish", "onLoginEnd"]];
+      ["weave:service:login:start",  "onLoginStart"],
+      ["weave:service:login:error",  "onLoginEnd"],
+      ["weave:service:login:finish", "onLoginEnd"]];
 
     // Add the observers now and remove them on unload
     let self = this;
     let addRem = function(add) {
       obs.forEach(function([topic, func]) {
         //XXXzpao This should use Services.obs.* but Weave's Obs does nice handling
         //        of `this`. Fix in a followup. (bug 583347)
         if (add)
@@ -211,16 +211,18 @@ var gSyncSetup = {
 
     let feedback;
     switch (Weave.Status.login) {
       case Weave.LOGIN_FAILED_NETWORK_ERROR:
       case Weave.LOGIN_FAILED_SERVER_ERROR:
         feedback = server;
         break;
       case Weave.LOGIN_FAILED_LOGIN_REJECTED:
+      case Weave.LOGIN_FAILED_NO_USERNAME:
+      case Weave.LOGIN_FAILED_NO_PASSWORD:
         feedback = password;
         break;
       case Weave.LOGIN_FAILED_INVALID_PASSPHRASE:
         feedback = passphrase;
         break;
     }
     this._setFeedbackMessage(feedback, false, Weave.Status.login);
   },
--- a/browser/base/content/syncUtils.js
+++ b/browser/base/content/syncUtils.js
@@ -189,22 +189,23 @@ let gSyncUtils = {
 
   /**
    * Save passphrase backup document to disk as HTML file.
    * 
    * @param elid : ID of the form element containing the passphrase.
    */
   passphraseSave: function(elid) {
     let dialogTitle = this.bundle.GetStringFromName("save.synckey.title");
+    let defaultSaveName = this.bundle.GetStringFromName("save.default.label");
     this._preparePPiframe(elid, function(iframe) {
       let filepicker = Cc["@mozilla.org/filepicker;1"]
                          .createInstance(Ci.nsIFilePicker);
       filepicker.init(window, dialogTitle, Ci.nsIFilePicker.modeSave);
       filepicker.appendFilters(Ci.nsIFilePicker.filterHTML);
-      filepicker.defaultString = "Firefox Sync Key.html";
+      filepicker.defaultString = defaultSaveName;
       let rv = filepicker.show();
       if (rv == Ci.nsIFilePicker.returnOK
           || rv == Ci.nsIFilePicker.returnReplace) {
         let stream = Cc["@mozilla.org/network/file-output-stream;1"]
                        .createInstance(Ci.nsIFileOutputStream);
         stream.init(filepicker.file, -1, -1, 0);
 
         let serializer = new XMLSerializer();
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1535,18 +1535,20 @@
                   this._removingTabs.length == 0 &&
                   (this._windowIsClosing = window.closeWindow(true)))
                 return null;
 
               newTab = true;
             }
 
             this._removingTabs.push(aTab);
-
-            this.tabContainer.updateVisibility();
+            if (newTab)
+              this.addTab("about:blank", {skipAnimation: true});
+            else
+              this.tabContainer.updateVisibility();
 
             // We're committed to closing the tab now.
             // Dispatch a notification.
             // We dispatch it before any teardown so that event listeners can
             // inspect the tab that's about to close.
             var evt = document.createEvent("UIEvent");
             evt.initUIEvent("TabClose", true, false, window, aTabWillBeMoved ? 1 : 0);
             aTab.dispatchEvent(evt);
@@ -1592,18 +1594,16 @@
               aCloseWindow = false;
               aNewTab = false;
             }
 
             this._lastRelatedTab = null;
 
             // update the UI early for responsiveness
             aTab.collapsed = true;
-            if (aNewTab)
-              this.addTab("about:blank", {skipAnimation: true});
             this.tabContainer._fillTrailingGap();
             this._blurTab(aTab);
 
             this._removingTabs.splice(this._removingTabs.indexOf(aTab), 1);
 
             if (aCloseWindow) {
               this._windowIsClosing = true;
               while (this._removingTabs.length)
@@ -2897,17 +2897,17 @@
               let numNormalTabs = tabs.length - numPinned;
               tabWidth = tabWidth * (numNormalTabs + 1) / numNormalTabs;
               if (tabWidth > this._tabDefaultMaxWidth)
                 tabWidth = this._tabDefaultMaxWidth;
             }
             tabWidth += "px";
             for (let i = numPinned; i < tabs.length; i++) {
               let tab = tabs[i];
-              tab.style.maxWidth = tabWidth;
+              tab.style.setProperty("max-width", tabWidth, "important");
               if (!isEndTab) { // keep tabs the same width
                 tab.style.MozTransition = "none";
                 tab.clientTop; // flush styles to skip animation; see bug 649247
                 tab.style.MozTransition = "";
               }
             }
             this._hasTabTempMaxWidth = true;
             this.tabbrowser.addEventListener("mousemove", this, false);
@@ -3137,22 +3137,25 @@
               event.screenY <= t.boxObject.screenY + t.boxObject.height)
             this.mTabstrip.ensureElementIsVisible(t);
         ]]></body>
       </method>
 
       <method name="_handleNewTab">
         <parameter name="tab"/>
         <body><![CDATA[
-          if (tab.parentNode != this || tab._fullyOpen)
+          if (tab.parentNode != this)
+            return;
+
+          this.adjustTabstrip();
+
+          if (tab._fullyOpen)
             return;
           tab._fullyOpen = true;
 
-          this.adjustTabstrip();
-
           if (tab.getAttribute("selected") == "true") {
             this._fillTrailingGap();
             this._handleTabSelect();
           } else {
             this._notifyBackgroundTab(tab);
           }
 
           // XXXmano: this is a temporary workaround for bug 345399
@@ -3730,17 +3733,22 @@
         <body><![CDATA[
           var tabContainer = gBrowser.tabContainer;
           // We don't want menu item decoration unless there is overflow.
           if (tabContainer.getAttribute("overflow") != "true")
             return;
 
           var tabstripBO = tabContainer.mTabstrip.scrollBoxObject;
           for (var i = 0; i < this.childNodes.length; i++) {
-            var curTabBO = this.childNodes[i].tab.boxObject;
+            let curTab = this.childNodes[i].tab;
+            if (!curTab) // "Tab Groups" menuitem and its menuseparator
+              continue;
+            let curTabBO = curTab.boxObject;
+            if (!curTabBO) // "Tabs From Other Computers" menuitem
+              continue;
             if (curTabBO.screenX >= tabstripBO.screenX &&
                 curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width)
               this.childNodes[i].setAttribute("tabIsVisible", "true"); 
             else
               this.childNodes[i].removeAttribute("tabIsVisible");
           }
         ]]></body>
       </method>
@@ -3807,17 +3815,17 @@
         this._updateTabsVisibilityStatus();
       ]]></handler>
 
       <handler event="popuphidden">
       <![CDATA[
         // clear out the menu popup and remove the listeners
         for (let i = this.childNodes.length - 1; i > 0; i--) {
           let menuItem = this.childNodes[i];
-          if (!menuItem.hasAttribute("keepme")) {
+          if (menuItem.tab) {
             menuItem.removeEventListener("command", this, false);
             menuItem.tab.mCorrespondingMenuitem = null;
             this.removeChild(menuItem);
           }
         }
         var tabcontainer = gBrowser.tabContainer;
         tabcontainer.mTabstrip.removeEventListener("scroll", this, false);
         tabcontainer.removeEventListener("TabOpen", this, false);
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -1908,32 +1908,32 @@ let GroupItems = {
     this._cleanupFunctions.push(function() {
       AllTabs.unregister("attrModified", handleAttrModified);
       AllTabs.unregister("close", handleClose);
     });
   },
 
   // ----------
   // Function: uninit
-  uninit : function GroupItems_uninit () {
+  uninit: function GroupItems_uninit() {
     // call our cleanup functions
     this._cleanupFunctions.forEach(function(func) {
       func();
     });
 
     this._cleanupFunctions = [];
 
     // additional clean up
     this.groupItems = null;
   },
 
   // ----------
   // Function: newGroup
   // Creates a new empty group.
-  newGroup: function () {
+  newGroup: function GroupItems_newGroup() {
     let bounds = new Rect(20, 20, 250, 200);
     return new GroupItem([], {bounds: bounds, immediately: true});
   },
 
   // ----------
   // Function: pauseArrange
   // Bypass arrange() calls and collect for resolution in
   // resumeArrange()
@@ -2158,17 +2158,26 @@ let GroupItems = {
               };
   
               new GroupItem([], Utils.extend({}, data, options));
             }
           }
         }
 
         toClose.forEach(function(groupItem) {
-          groupItem.destroy({immediately: true});
+          // All remaining children in to-be-closed groups are re-used by
+          // session restore. Reconnect them so that they're put into their
+          // right groups.
+          groupItem.getChildren().forEach(function (tabItem) {
+            if (tabItem.parent && tabItem.parent.hidden)
+              iQ(tabItem.container).show();
+            tabItem._reconnected = false;
+            tabItem._reconnect();
+          });
+          groupItem.close({immediately: true});
         });
       }
 
       // set active group item
       if (activeGroupId) {
         let activeGroupItem = this.groupItem(activeGroupId);
         if (activeGroupItem)
           UI.setActive(activeGroupItem);
--- a/browser/base/content/tabview/modules/AllTabs.jsm
+++ b/browser/base/content/tabview/modules/AllTabs.jsm
@@ -52,17 +52,20 @@ let 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
     return Array.concat.apply(null, browserWindows.map(function(browserWindow) {
-      return Array.slice(browserWindow.gBrowser.tabs);
+      let removingTabs = browserWindow.gBrowser._removingTabs;
+      return Array.filter(browserWindow.gBrowser.tabs, function (tab) {
+        return removingTabs.indexOf(tab) == -1;
+      });
     }));
   },
 
   /**
    * Attach a callback for a given tab event.
    *
    * @param eventName
    *        Name of the corresponding Tab* Event; one of "attrModified",
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -547,16 +547,19 @@ let UI = {
       self.setActive(null, { onlyRemoveActiveTab: true });
       dispatchEvent(event);
 
       // Flush pending updates
       GroupItems.flushAppTabUpdates();
 
       TabItems.resumePainting();
     }
+
+    if (gTabView.firstUseExperienced)
+      gTabView.enableSessionRestore();
   },
 
   // ----------
   // Function: hideTabView
   // Hides TabView and shows the main browser UI.
   hideTabView: function UI_hideTabView() {
     if (!this.isTabViewVisible())
       return;
@@ -734,19 +737,19 @@ let UI = {
         
       if (self.isTabViewVisible()) {
         // just closed the selected tab in the TabView interface.
         if (self._currentTab == tab)
           self._closedSelectedTabInTabView = true;
       } else {
         // If we're currently in the process of entering private browsing,
         // we don't want to go to the Tab View UI. 
-        if (self._privateBrowsing.transitionMode)
-          return; 
-          
+        if (self._storageBusyCount)
+          return;
+
         // if not closing the last tab
         if (gBrowser.tabs.length > 1) {
           // Don't return to TabView if there are any app tabs
           for (let a = 0; a < gBrowser._numPinnedTabs; a++) {
             let theTab = gBrowser.tabs[a]; 
             if (gBrowser._removingTabs.indexOf(theTab) == -1) 
               return;
           }
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -189,22 +189,24 @@ endif
                  browser_inspector_scrolling.js \
                  browser_inspector_store.js \
                  browser_inspector_tab_switch.js \
                  browser_inspector_treePanel_output.js \
                  browser_inspector_treePanel_input.html \
                  browser_inspector_treePanel_result.html \
                  browser_scratchpad_initialization.js \
                  browser_scratchpad_contexts.js \
+                 browser_scratchpad_tab_switch.js \
                  browser_scratchpad_execute_print.js \
                  browser_scratchpad_inspect.js \
                  browser_scratchpad_files.js \
                  browser_scratchpad_ui.js \
                  browser_scratchpad_bug_646070_chrome_context_pref.js \
                  browser_overflowScroll.js \
+                 browser_locationBarExternalLoad.js \
                  browser_pageInfo.js \
                  browser_page_style_menu.js \
                  browser_pinnedTabs.js \
                  browser_plainTextLinks.js \
                  browser_pluginnotification.js \
                  browser_relatedTabs.js \
                  browser_sanitize-passwordDisabledHosts.js \
                  browser_sanitize-sitepermissions.js \
--- a/browser/base/content/test/browser_bug553455.js
+++ b/browser/base/content/test/browser_bug553455.js
@@ -91,21 +91,20 @@ function test_disabled_install() {
     let notification = aPanel.childNodes[0];
     is(notification.id, "xpinstall-disabled-notification", "Should have seen installs disabled");
     is(notification.button.label, "Enable", "Should have seen the right button");
     is(notification.getAttribute("label"),
        "Software installation is currently disabled. Click Enable and try again.");
 
     wait_for_notification_close(function() {
       try {
-        Services.prefs.getBoolPref("xpinstall.disabled");
-        ok(false, "xpinstall.disabled should not be set");
+        ok(Services.prefs.getBoolPref("xpinstall.enabled"), "Installation should be enabled");
       }
       catch (e) {
-        ok(true, "xpinstall.disabled should not be set");
+        ok(false, "xpinstall.enabled should be set");
       }
 
       gBrowser.removeTab(gBrowser.selectedTab);
 
       AddonManager.getAllInstalls(function(aInstalls) {
         is(aInstalls.length, 1, "Should have been one install created");
         aInstalls[0].cancel();
 
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_locationBarExternalLoad.js
@@ -0,0 +1,45 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  nextTest();
+}
+
+let urls = [
+  "javascript:'foopy';",
+  "data:text/html,<script>document.write(document.domain);</script>"
+];
+
+function nextTest() {
+  let url = urls.shift();
+  if (url)
+    testURL(url, nextTest);
+  else
+    finish();
+}
+
+function testURL(newURL, func) {
+  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  registerCleanupFunction(function () {
+    gBrowser.removeTab(tab);
+  });
+  addPageShowListener(function () {
+    let pagePrincipal = gBrowser.contentPrincipal;
+    gURLBar.value = newURL;
+    gURLBar.handleCommand();
+
+    addPageShowListener(function () {
+      ok(!gBrowser.contentPrincipal.equals(pagePrincipal), "load of " + newURL + " produced a page with a different principal");
+      func();
+    });
+  });
+}
+
+function addPageShowListener(func) {
+  gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() {
+    gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false);
+    func();
+  });
+}
--- a/browser/base/content/test/browser_pluginnotification.js
+++ b/browser/base/content/test/browser_pluginnotification.js
@@ -122,17 +122,22 @@ function test2() {
 function test3() {
   var notificationBox = gBrowser.getNotificationBox(gTestBrowser);
   ok(!notificationBox.getNotificationWithValue("missing-plugins"), "Test 3, Should not have displayed the missing plugin notification");
   ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 3, Should not have displayed the blocked plugin notification");
   ok(!gTestBrowser.missingPlugins, "Test 3, Should not be a missing plugin list");
 
   new TabOpenListener("about:addons", test4, prepareTest5);
 
-  EventUtils.synthesizeMouse(gTestBrowser.contentDocument.getElementById("test"),
+  var pluginNode = gTestBrowser.contentDocument.getElementById("test");
+  ok(pluginNode, "Test 3, Found plugin in page");
+  var manageLink = gTestBrowser.contentDocument.getAnonymousElementByAttribute(pluginNode, "class", "managePluginsLink");
+  ok(manageLink, "Test 3, found 'manage' link in plugin-problem binding");
+
+  EventUtils.synthesizeMouse(manageLink,
                              5, 5, {}, gTestBrowser.contentWindow);
 }
 
 function test4(tab, win) {
   is(win.wrappedJSObject.gViewController.currentViewId, "addons://list/plugin", "Should have displayed the plugins pane");
   gBrowser.removeTab(tab);
 }
 
--- a/browser/base/content/test/browser_scratchpad_bug_646070_chrome_context_pref.js
+++ b/browser/base/content/test/browser_scratchpad_bug_646070_chrome_context_pref.js
@@ -31,17 +31,17 @@ function test()
 function runTests()
 {
   gScratchpadWindow.removeEventListener("load", arguments.callee, false);
 
   let sp = gScratchpadWindow.Scratchpad;
   ok(sp, "Scratchpad object exists in new window");
 
   let chromeContextMenu = gScratchpadWindow.document.
-                          getElementById("sp-menu-chrome");
+                          getElementById("sp-menu-browser");
   ok(chromeContextMenu, "Chrome context menuitem element exists");
   ok(!chromeContextMenu.hasAttribute("hidden"),
      "Chrome context menuitem is visible");
 
   let errorConsoleCommand = gScratchpadWindow.document.
                             getElementById("sp-cmd-errorConsole");
   ok(errorConsoleCommand, "Error console command element exists");
   ok(!errorConsoleCommand.hasAttribute("disabled"),
@@ -49,17 +49,17 @@ function runTests()
 
   let errorConsoleMenu = gScratchpadWindow.document.
                          getElementById("sp-menu-errorConsole");
   ok(errorConsoleMenu, "Error console menu element exists");
   ok(!errorConsoleMenu.hasAttribute("hidden"),
      "Error console menuitem is visible");
 
   let chromeContextCommand = gScratchpadWindow.document.
-                            getElementById("sp-cmd-chromeContext");
+                            getElementById("sp-cmd-browserContext");
   ok(chromeContextCommand, "Chrome context command element exists");
   ok(!chromeContextCommand.hasAttribute("disabled"),
      "Chrome context command is disabled");
 
   Services.prefs.setBoolPref(DEVTOOLS_CHROME_ENABLED, gOldPref);
 
   gScratchpadWindow.close();
   gScratchpadWindow = null;
--- a/browser/base/content/test/browser_scratchpad_contexts.js
+++ b/browser/base/content/test/browser_scratchpad_contexts.js
@@ -22,21 +22,21 @@ function test()
 
 function runTests()
 {
   gScratchpadWindow.removeEventListener("load", arguments.callee, false);
 
   let sp = gScratchpadWindow.Scratchpad;
 
   let contentMenu = gScratchpadWindow.document.getElementById("sp-menu-content");
-  let chromeMenu = gScratchpadWindow.document.getElementById("sp-menu-chrome");
+  let chromeMenu = gScratchpadWindow.document.getElementById("sp-menu-browser");
   let statusbar = sp.statusbarStatus;
 
   ok(contentMenu, "found #sp-menu-content");
-  ok(chromeMenu, "found #sp-menu-chrome");
+  ok(chromeMenu, "found #sp-menu-browser");
   ok(statusbar, "found Scratchpad.statusbarStatus");
 
   sp.setContentContext();
 
   is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_CONTENT,
      "executionContext is content");
 
   is(contentMenu.getAttribute("checked"), "true",
@@ -49,77 +49,77 @@ function runTests()
      "statusbar label is correct");
 
   ok(sp.textbox, "textbox exists");
   sp.textbox.value = "window.foobarBug636725 = 'aloha';";
 
   ok(!content.wrappedJSObject.foobarBug636725,
      "no content.foobarBug636725");
 
-  sp.execute();
+  sp.run();
 
   is(content.wrappedJSObject.foobarBug636725, "aloha",
      "content.foobarBug636725 has been set");
 
-  sp.setChromeContext();
+  sp.setBrowserContext();
 
-  is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_CHROME,
+  is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_BROWSER,
      "executionContext is chrome");
 
   is(chromeMenu.getAttribute("checked"), "true",
      "chrome menuitem is checked");
 
   ok(!contentMenu.hasAttribute("checked"),
      "content menuitem is not checked");
 
   is(statusbar.getAttribute("label"), chromeMenu.getAttribute("label"),
      "statusbar label is correct");
 
   sp.textbox.value = "window.foobarBug636725 = 'aloha2';";
 
   ok(!window.foobarBug636725, "no window.foobarBug636725");
 
-  sp.execute();
+  sp.run();
 
   is(window.foobarBug636725, "aloha2", "window.foobarBug636725 has been set");
 
   sp.textbox.value = "window.gBrowser";
 
-  is(typeof sp.execute()[1].addTab, "function",
+  is(typeof sp.run()[1].addTab, "function",
      "chrome context has access to chrome objects");
 
   // Check that the sandbox is cached.
 
   sp.textbox.value = "typeof foobarBug636725cache;";
-  is(sp.execute()[1], "undefined", "global variable does not exist");
+  is(sp.run()[1], "undefined", "global variable does not exist");
 
   sp.textbox.value = "var foobarBug636725cache = 'foo';";
-  sp.execute();
+  sp.run();
 
   sp.textbox.value = "typeof foobarBug636725cache;";
-  is(sp.execute()[1], "string",
+  is(sp.run()[1], "string",
      "global variable exists across two different executions");
 
   sp.resetContext();
 
-  is(sp.execute()[1], "undefined",
+  is(sp.run()[1], "undefined",
      "global variable no longer exists after calling resetContext()");
 
   sp.textbox.value = "var foobarBug636725cache2 = 'foo';";
-  sp.execute();
+  sp.run();
 
   sp.textbox.value = "typeof foobarBug636725cache2;";
-  is(sp.execute()[1], "string",
+  is(sp.run()[1], "string",
      "global variable exists across two different executions");
 
   sp.setContentContext();
 
   is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_CONTENT,
      "executionContext is content");
 
-  is(sp.execute()[1], "undefined",
+  is(sp.run()[1], "undefined",
      "global variable no longer exists after changing the context");
 
   gScratchpadWindow.close();
   gScratchpadWindow = null;
   gBrowser.removeCurrentTab();
   finish();
 }
--- a/browser/base/content/test/browser_scratchpad_execute_print.js
+++ b/browser/base/content/test/browser_scratchpad_execute_print.js
@@ -12,42 +12,42 @@ function test()
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
 
     gScratchpadWindow = Scratchpad.openScratchpad();
     gScratchpadWindow.addEventListener("load", runTests, false);
   }, true);
 
-  content.location = "data:text/html,<p>test execute() and print() in Scratchpad";
+  content.location = "data:text/html,<p>test run() and display() in Scratchpad";
 }
 
 function runTests()
 {
   gScratchpadWindow.removeEventListener("load", arguments.callee, false);
 
   let sp = gScratchpadWindow.Scratchpad;
 
   content.wrappedJSObject.foobarBug636725 = 1;
 
   ok(sp.textbox, "textbox exists");
   sp.textbox.value = "++window.foobarBug636725";
 
-  let exec = sp.execute();
+  let exec = sp.run();
   is(exec[0], sp.textbox.value, "execute()[0] is correct");
   is(exec[1], content.wrappedJSObject.foobarBug636725,
      "execute()[1] is correct");
 
   is(sp.textbox.value, "++window.foobarBug636725",
      "execute() does not change the textbox value");
 
   is(content.wrappedJSObject.foobarBug636725, 2,
      "execute() updated window.foobarBug636725");
 
-  sp.print();
+  sp.display();
 
   is(content.wrappedJSObject.foobarBug636725, 3,
      "print() updated window.foobarBug636725");
 
   is(sp.textbox.value, "++window.foobarBug636725/*\n3\n*/",
      "print() shows evaluation result in the textbox");
 
   is(sp.selectedText, "/*\n3\n*/", "selectedText is correct");
@@ -64,17 +64,17 @@ function runTests()
   is(sp.textbox.selectionStart, 1, "selectionStart is 1");
   is(sp.textbox.selectionEnd, 2, "selectionEnd is 2");
 
   sp.selectRange(0, 29);
 
   is(sp.textbox.selectionStart, 0, "selectionStart is 0");
   is(sp.textbox.selectionEnd, 29, "selectionEnd is 29");
 
-  exec = sp.execute();
+  exec = sp.run();
 
   is(exec[0], "window.foobarBug636725 = 'a';",
      "execute()[0] is correct");
   is(exec[1], "a",
      "execute()[1] is correct");
 
   is(sp.textbox.value, "window.foobarBug636725 = 'a';\n" +
                        "window.foobarBug636725 = 'b';",
@@ -83,17 +83,17 @@ function runTests()
   is(content.wrappedJSObject.foobarBug636725, "a",
      "execute() worked for the selected range");
 
   sp.textbox.value = "window.foobarBug636725 = 'c';\n" +
                      "window.foobarBug636725 = 'b';";
 
   sp.selectRange(0, 22);
 
-  sp.print();
+  sp.display();
 
   is(content.wrappedJSObject.foobarBug636725, "a",
      "print() worked for the selected range");
 
   is(sp.textbox.value, "window.foobarBug636725" +
                        "/*\na\n*/" +
                        " = 'c';\n" +
                        "window.foobarBug636725 = 'b';",
--- a/browser/base/content/test/browser_scratchpad_initialization.js
+++ b/browser/base/content/test/browser_scratchpad_initialization.js
@@ -23,22 +23,22 @@ function test()
 }
 
 function runTests()
 {
   gScratchpadWindow.removeEventListener("load", arguments.callee, false);
 
   let sp = gScratchpadWindow.Scratchpad;
   ok(sp, "Scratchpad object exists in new window");
-  is(typeof sp.execute, "function", "Scratchpad.execute() exists");
+  is(typeof sp.run, "function", "Scratchpad.run() exists");
   is(typeof sp.inspect, "function", "Scratchpad.inspect() exists");
-  is(typeof sp.print, "function", "Scratchpad.print() exists");
+  is(typeof sp.display, "function", "Scratchpad.display() exists");
 
   let chromeContextMenu = gScratchpadWindow.document.
-                          getElementById("sp-menu-chrome");
+                          getElementById("sp-menu-browser");
   ok(chromeContextMenu, "Chrome context menuitem element exists");
   is(chromeContextMenu.getAttribute("hidden"), "true",
      "Chrome context menuitem is hidden");
 
   let errorConsoleCommand = gScratchpadWindow.document.
                             getElementById("sp-cmd-errorConsole");
   ok(errorConsoleCommand, "Error console command element exists");
   is(errorConsoleCommand.getAttribute("disabled"), "true",
@@ -46,17 +46,17 @@ function runTests()
 
   let errorConsoleMenu = gScratchpadWindow.document.
                          getElementById("sp-menu-errorConsole");
   ok(errorConsoleMenu, "Error console menu element exists");
   is(errorConsoleMenu.getAttribute("hidden"), "true",
      "Error console menu item is hidden");
 
   let chromeContextCommand = gScratchpadWindow.document.
-                            getElementById("sp-cmd-chromeContext");
+                            getElementById("sp-cmd-browserContext");
   ok(chromeContextCommand, "Chrome context command element exists");
   is(chromeContextCommand.getAttribute("disabled"), "true",
      "Chrome context command is disabled");
 
   gScratchpadWindow.close();
   gScratchpadWindow = null;
   gBrowser.removeCurrentTab();
   finish();
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_scratchpad_tab_switch.js
@@ -0,0 +1,111 @@
+/* vim: set ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Reference to the Scratchpad chrome window object.
+let gScratchpadWindow;
+let tab1;
+let tab2;
+let sp;
+
+function test()
+{
+  waitForExplicitFinish();
+
+  tab1 = gBrowser.addTab();
+  gBrowser.selectedTab = tab1;
+  gBrowser.selectedBrowser.addEventListener("load", function() {
+    gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
+
+    tab2 = gBrowser.addTab();
+    gBrowser.selectedTab = tab2;
+    gBrowser.selectedBrowser.addEventListener("load", function() {
+      gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
+      gScratchpadWindow = Scratchpad.openScratchpad();
+      gScratchpadWindow.addEventListener("load", runTests, false);
+    }, true);
+    content.location = "data:text/html,test context switch in Scratchpad tab 2";
+  }, true);
+
+  content.location = "data:text/html,test context switch in Scratchpad tab 1";
+}
+
+function runTests()
+{
+  gScratchpadWindow.removeEventListener("load", runTests, true);
+
+  sp = gScratchpadWindow.Scratchpad;
+
+  let contentMenu = gScratchpadWindow.document.getElementById("sp-menu-content");
+  let browserMenu = gScratchpadWindow.document.getElementById("sp-menu-browser");
+  let statusbar = sp.statusbarStatus;
+
+  ok(contentMenu, "found #sp-menu-content");
+  ok(browserMenu, "found #sp-menu-browser");
+  ok(statusbar, "found Scratchpad.statusbarStatus");
+
+  sp.setContentContext();
+
+  is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_CONTENT,
+     "executionContext is content");
+
+  is(contentMenu.getAttribute("checked"), "true",
+     "content menuitem is checked");
+
+  ok(!browserMenu.hasAttribute("checked"),
+     "chrome menuitem is not checked");
+
+  is(statusbar.getAttribute("label"), contentMenu.getAttribute("label"),
+     "statusbar label is correct");
+
+  ok(sp.textbox, "textbox exists");
+  sp.textbox.value = "window.foosbug653108 = 'aloha';";
+
+  ok(!content.wrappedJSObject.foosbug653108,
+     "no content.foosbug653108");
+
+  sp.run();
+
+  is(content.wrappedJSObject.foosbug653108, "aloha",
+     "content.foosbug653108 has been set");
+
+  gBrowser.tabContainer.addEventListener("TabSelect", runTests2, true);
+  gBrowser.selectedTab = tab1;
+}
+
+function runTests2() {
+  gBrowser.tabContainer.removeEventListener("TabSelect", runTests2, true);
+
+  ok(!window.foosbug653108, "no window.foosbug653108");
+
+  sp.textbox.value = "window.foosbug653108";
+  let result = sp.run();
+
+  isnot(result, "aloha", "window.foosbug653108 is not aloha");
+
+  sp.textbox.value = "window.foosbug653108 = 'ahoyhoy';";
+  sp.run();
+
+  is(content.wrappedJSObject.foosbug653108, "ahoyhoy",
+     "content.foosbug653108 has been set 2");
+
+  gBrowser.selectedBrowser.addEventListener("load", runTests3, true);
+  content.location = "data:text/html,test context switch in Scratchpad location 2";
+}
+
+function runTests3() {
+  gBrowser.selectedBrowser.removeEventListener("load", runTests3, true);
+  // Check that the sandbox is not cached.
+
+  sp.textbox.value = "typeof foosbug653108;";
+  is(sp.run()[1], "undefined", "global variable does not exist");
+
+  gScratchpadWindow.close();
+  gScratchpadWindow = null;
+  tab1 = null;
+  tab2 = null;
+  sp = null;
+  gBrowser.removeCurrentTab();
+  gBrowser.removeCurrentTab();
+  finish();
+}
--- a/browser/base/content/test/browser_scratchpad_ui.js
+++ b/browser/base/content/test/browser_scratchpad_ui.js
@@ -28,20 +28,21 @@ function runTests()
   let sp = gScratchpadWindow.Scratchpad;
   let doc = gScratchpadWindow.document;
 
   let methodsAndItems = {
     "sp-menu-newscratchpad": "openScratchpad",
     "sp-menu-open": "openFile",
     "sp-menu-save": "saveFile",
     "sp-menu-saveas": "saveFileAs",
-    "sp-text-execute": "execute",
+    "sp-text-run": "run",
     "sp-text-inspect": "inspect",
+    "sp-text-display": "display",
     "sp-menu-content": "setContentContext",
-    "sp-menu-chrome": "setChromeContext",
+    "sp-menu-browser": "setBrowserContext",
     "sp-menu-resetContext": "resetContext",
     "sp-menu-errorConsole": "openErrorConsole",
     "sp-menu-webConsole": "openWebConsole",
   };
 
   let lastMethodCalled = null;
   sp.__noSuchMethod__ = function(aMethodName) {
     lastMethodCalled = aMethodName;
--- a/browser/base/content/test/browser_urlHighlight.js
+++ b/browser/base/content/test/browser_urlHighlight.js
@@ -20,16 +20,22 @@ function test() {
 
   registerCleanupFunction(function () {
     Services.prefs.clearUserPref(prefname);
     URLBarSetURI();
   });
 
   Services.prefs.setBoolPref(prefname, true);
 
+  gURLBar.focus();
+
+  testVal("http://mozilla.org/");
+
+  gBrowser.selectedBrowser.focus();
+
   testVal("<http://>mozilla.org");
   testVal("<http://>mozilla.org</>");
   testVal("<http://>mözilla.org</>");
   testVal("<http://>mozilla.imaginatory</>");
   testVal("<http://www.>mozilla.org</>");
   testVal("<http://sub.>mozilla.org</>");
   testVal("<http://sub1.sub2.sub3.>mozilla.org</>");
   testVal("<http://ftp.>mozilla.org</>");
--- a/browser/base/content/test/browser_visibleTabs_contextMenu.js
+++ b/browser/base/content/test/browser_visibleTabs_contextMenu.js
@@ -51,17 +51,17 @@ function test() {
   // Hide the original tab.
   gBrowser.selectedTab = testTab;
   gBrowser.showOnlyTheseTabs([testTab]);
   is(gBrowser.visibleTabs.length, 1, "now there is only one visible tab");
   
   // Check the context menu with one tab.
   popup(testTab);
   is(TabContextMenu.contextTab, testTab, "TabContextMenu context is the test tab");
-  is(document.getElementById("context_closeTab").disabled, true, "Close Tab is disabled");
+  is(document.getElementById("context_closeTab").disabled, false, "Close Tab is enabled when more than one tab exists");
   is(document.getElementById("context_reloadAllTabs").disabled, true, "Reload All Tabs is disabled");
   
   // Add a tab that will get pinned
   // So now there's one pinned tab, one visible unpinned tab, and one hidden tab
   let pinned = gBrowser.addTab();
   gBrowser.pinTab(pinned);
   is(gBrowser.visibleTabs.length, 2, "now there are two visible tabs");
 
--- a/browser/base/content/test/plugin_test.html
+++ b/browser/base/content/test/plugin_test.html
@@ -1,5 +1,5 @@
 <html>
 <body>
-<embed id="test" style="width: 100px; height: 100px" type="application/x-test">
+<embed id="test" style="width: 200px; height: 200px" type="application/x-test">
 </body>
 </html>
--- a/browser/base/content/test/tabview/Makefile.in
+++ b/browser/base/content/test/tabview/Makefile.in
@@ -59,16 +59,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug590606.js \
                  browser_tabview_bug591706.js \
                  browser_tabview_bug594958.js \
                  browser_tabview_bug595191.js \
                  browser_tabview_bug595436.js \
                  browser_tabview_bug595518.js \
                  browser_tabview_bug595521.js \
                  browser_tabview_bug595560.js \
+                 browser_tabview_bug595601.js \
                  browser_tabview_bug595804.js \
                  browser_tabview_bug595930.js \
                  browser_tabview_bug595943.js \
                  browser_tabview_bug595965.js \
                  browser_tabview_bug596781.js \
                  browser_tabview_bug597248.js \
                  browser_tabview_bug597360.js \
                  browser_tabview_bug597399.js \
@@ -100,16 +101,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug622872.js \
                  browser_tabview_bug623768.js \
                  browser_tabview_bug624265.js \
                  browser_tabview_bug624692.js \
                  browser_tabview_bug624727.js \
                  browser_tabview_bug624847.js \
                  browser_tabview_bug624931.js \
                  browser_tabview_bug624953.js \
+                 browser_tabview_bug625195.js \
                  browser_tabview_bug625269.js \
                  browser_tabview_bug625424.js \
                  browser_tabview_bug625666.js \
                  browser_tabview_bug626368.js \
                  browser_tabview_bug626525.js \
                  browser_tabview_bug626791.js \
                  browser_tabview_bug627288.js \
                  browser_tabview_bug627736.js \
@@ -125,23 +127,26 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug634077.js \
                  browser_tabview_bug634085.js \
                  browser_tabview_bug634158.js \
                  browser_tabview_bug634672.js \
                  browser_tabview_bug635696.js \
                  browser_tabview_bug640765.js \
                  browser_tabview_bug641802.js \
                  browser_tabview_bug642793.js \
+                 browser_tabview_bug643392.js \
                  browser_tabview_bug644097.js \
                  browser_tabview_bug645653.js \
                  browser_tabview_bug648882.js \
                  browser_tabview_bug649006.js \
                  browser_tabview_bug649307.js \
+                 browser_tabview_bug650573.js \
                  browser_tabview_bug651311.js \
                  browser_tabview_bug654941.js \
+                 browser_tabview_bug656778.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 \
--- a/browser/base/content/test/tabview/browser_tabview_bug589324.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug589324.js
@@ -1,93 +1,121 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+
+const DUMMY_PAGE_URL = "http://mochi.test:8888/browser/browser/base/content/test/tabview/dummy_page.html";
+const DUMMY_PAGE_URL_2 = "http://mochi.test:8888/";
+
+let state = {
+  windows: [{
+    tabs: [{
+      entries: [{ url: DUMMY_PAGE_URL }],
+      hidden: true,
+      attributes: {},
+      extData: {
+        "tabview-tab":
+          '{"bounds":{"left":21,"top":29,"width":204,"height":153},' +
+          '"userSize":null,"url":"' + DUMMY_PAGE_URL + '","groupID":1,' + 
+          '"imageData":null,"title":null}'
+      }
+    },{
+      entries: [{ url: DUMMY_PAGE_URL_2 }],
+      hidden: false,
+      attributes: {},
+      extData: {
+        "tabview-tab": 
+          '{"bounds":{"left":315,"top":29,"width":111,"height":84},' + 
+          '"userSize":null,"url":"' + DUMMY_PAGE_URL_2 + '","groupID":2,' + 
+          '"imageData":null,"title":null}'
+      },
+    }],
+    selected:2,
+    _closedTabs: [],
+    extData: {
+      "tabview-groups": '{"nextID":3,"activeGroupId":2}',
+      "tabview-group": 
+        '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},' + 
+        '"userSize":null,"title":"","id":1},' + 
+        '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},' + 
+        '"userSize":null,"title":"","id":2}}',
+      "tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":788,"height":548}}'
+    }, sizemode:"normal"
+  }]
+};
+
 function test() {
-  const DUMMY_PAGE_URL = "http://mochi.test:8888/browser/browser/base/content/test/tabview/dummy_page.html";
-  const DUMMY_PAGE_URL_2 = "http://mochi.test:8888/";
-
-  let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
   waitForExplicitFinish();
 
-  // open a new window and setup the window state.
-  let newWin = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
-  newWin.addEventListener("load", function(event) {
-    this.removeEventListener("load", arguments.callee, false);
+  registerCleanupFunction(function () {
+    Services.prefs.clearUserPref("browser.sessionstore.restore_hidden_tabs");
+  });
+
+  Services.prefs.setBoolPref("browser.sessionstore.restore_hidden_tabs", false);
+
+  testTabSwitchAfterRestore(function () {
+    Services.prefs.setBoolPref("browser.sessionstore.restore_hidden_tabs", true);
+
+    testTabSwitchAfterRestore(function () {
+      waitForFocus(finish);
+    });
+  });
+}
+
+function testTabSwitchAfterRestore(callback) {
+  newWindowWithState(state, function (win) {
+    registerCleanupFunction(function () win.close());
+
+    let [firstTab, secondTab] = win.gBrowser.tabs;
+    is(firstTab.linkedBrowser.currentURI.spec, DUMMY_PAGE_URL,
+       "The url of first tab url is dummy_page.html");
+
+    // check the hidden state of both tabs.
+    ok(firstTab.hidden, "The first tab is hidden");
+    ok(!secondTab.hidden, "The second tab is not hidden");
+    is(secondTab, win.gBrowser.selectedTab, "The second tab is selected");
 
-    let newState = {
-      windows: [{
-        tabs: [{
-          entries: [{ url: DUMMY_PAGE_URL }],
-          hidden: true,
-          attributes: {},
-          extData: {
-            "tabview-tab":
-              '{"bounds":{"left":21,"top":29,"width":204,"height":153},' +
-              '"userSize":null,"url":"' + DUMMY_PAGE_URL + '","groupID":1,' + 
-              '"imageData":null,"title":null}'
-          }
-        },{
-          entries: [{ url: DUMMY_PAGE_URL_2 }],
-          hidden: false,
-          attributes: {},
-          extData: {
-            "tabview-tab": 
-              '{"bounds":{"left":315,"top":29,"width":111,"height":84},' + 
-              '"userSize":null,"url":"' + DUMMY_PAGE_URL_2 + '","groupID":2,' + 
-              '"imageData":null,"title":null}'
-          },
-        }],
-        selected:2,
-        _closedTabs: [],
-        extData: {
-          "tabview-groups": '{"nextID":3,"activeGroupId":2}',
-          "tabview-group": 
-            '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},' + 
-            '"userSize":null,"title":"","id":1},' + 
-            '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},' + 
-            '"userSize":null,"title":"","id":2}}',
-          "tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":788,"height":548}}'
-        }, sizemode:"normal"
-      }]
-    };
-    ss.setWindowState(newWin, JSON.stringify(newState), true);
+    // when the second tab is hidden, Panorama should be initialized and
+    // the first tab should be visible.
+    let container = win.gBrowser.tabContainer;
+    container.addEventListener("TabHide", function onTabHide() {
+      container.removeEventListener("TabHide", onTabHide, false);
+
+      ok(win.TabView.getContentWindow(), "Panorama is loaded");
+      ok(!firstTab.hidden, "The first tab is not hidden");
+      is(firstTab, win.gBrowser.selectedTab, "The first tab is selected");
+      ok(secondTab.hidden, "The second tab is hidden");
+
+      callback();
+    }, false);
 
-    let firstTab = newWin.gBrowser.tabs[0];
-    let secondTab = newWin.gBrowser.tabs[1];
-
-    // wait until the first tab is fully loaded
-    let browser = newWin.gBrowser.getBrowserForTab(firstTab);
-    let onLoad = function() {
-      browser.removeEventListener("load", onLoad, true);
+    // switch to another tab
+    win.switchToTabHavingURI(DUMMY_PAGE_URL);
+  });
+}
 
-      is(browser.currentURI.spec, DUMMY_PAGE_URL, 
-         "The url of first tab url is dummy_page.html");
-
-      // check the hidden state of both tabs.
-      ok(firstTab.hidden, "The first tab is hidden");
-      ok(!secondTab.hidden, "The second tab is not hidden");
-      is(secondTab, newWin.gBrowser.selectedTab, "The second tab is selected");
+function newWindowWithState(state, callback) {
+  let opts = "chrome,all,dialog=no,height=800,width=800";
+  let win = window.openDialog(getBrowserURL(), "_blank", opts);
 
-      // when the second tab is hidden, the iframe should be initialized and 
-      // the first tab should be visible.
-      let onTabHide = function() {
-        newWin.gBrowser.tabContainer.removeEventListener("TabHide", onTabHide, true);
-
-        ok(newWin.TabView.getContentWindow(), "");
-
-        ok(!firstTab.hidden, "The first tab is not hidden");
-        is(firstTab, newWin.gBrowser.selectedTab, "The first tab is selected");
-        ok(secondTab.hidden, "The second tab is hidden");
+  whenWindowLoaded(win, function () {
+    ss.setWindowState(win, JSON.stringify(state), true);
+  });
 
-        // clean up and finish
-        newWin.close();
+  whenWindowStateReady(win, function () {
+    afterAllTabsLoaded(function () callback(win), win);
+  });
+}
 
-        finish();
-      };
-      newWin.gBrowser.tabContainer.addEventListener("TabHide", onTabHide, true);
-
-      // switch to another tab
-      newWin.switchToTabHavingURI(DUMMY_PAGE_URL);
-    }
-    browser.addEventListener("load", onLoad, true);
+function whenWindowLoaded(win, callback) {
+  win.addEventListener("load", function onLoad() {
+    win.removeEventListener("load", onLoad, false);
+    executeSoon(callback);
   }, false);
 }
+
+function whenWindowStateReady(win, callback) {
+  win.addEventListener("SSWindowStateReady", function onReady() {
+    win.removeEventListener("SSWindowStateReady", onReady, false);
+    executeSoon(callback);
+  }, false);
+}
--- a/browser/base/content/test/tabview/browser_tabview_bug595560.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug595560.js
@@ -1,134 +1,97 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-let newTabOne;
-let originalTab;
+let win;
+let cw;
 
 function test() {
   waitForExplicitFinish();
 
-  originalTab = gBrowser.visibleTabs[0];
-  newTabOne = gBrowser.addTab("http://mochi.test:8888/");
+  let onLoad = function (tvwin) {
+    win = tvwin;
+    registerCleanupFunction(function () win.close());
+    win.gBrowser.loadOneTab("http://mochi.test:8888/", {inBackground: true});
+  };
+
+  let onShow = function () {
+    cw = win.TabView.getContentWindow();
+    ok(win.TabView.isVisible(), "Tab View is visible");
+    afterAllTabItemsUpdated(testOne, win);
+  };
 
-  let browser = gBrowser.getBrowserForTab(newTabOne);
-  let onLoad = function() {
-    browser.removeEventListener("load", onLoad, true);
-    
-    // show the tab view
-    window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
-    TabView.toggle();
-  }
-  browser.addEventListener("load", onLoad, true);
+  newWindowWithTabView(onShow, onLoad);
+}
+
+function testOne() {
+  whenSearchEnabledAndDisabled(testTwo);
+  // press cmd/ctrl F
+  EventUtils.synthesizeKey("f", {accelKey: true}, cw);
+}
+
+function testTwo() {
+  whenSearchEnabledAndDisabled(testThree);
+  // press /
+  EventUtils.synthesizeKey("VK_SLASH", {}, cw);
 }
 
-function onTabViewWindowLoaded() {
-  window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
-  ok(TabView.isVisible(), "Tab View is visible");
+function testThree() {
+  let onTabViewShown = function () {
+    is(cw.UI.getActiveTab(), groupItem.getChild(0), 
+       "The active tab is newly created tab item");
+
+    let onSearchEnabled = function () {
+      let doc = cw.document;
+      let searchBox = cw.iQ("#searchbox");
+      let hasFocus = doc.hasFocus() && doc.activeElement == searchBox[0];
+      ok(hasFocus, "The search box has focus");
+
+      let tab = win.gBrowser.tabs[1];
+      searchBox.val(tab._tabViewTabItem.$tabTitle[0].innerHTML);
+
+      cw.performSearch();
+
+      whenTabViewIsHidden(function () {
+        is(tab, win.gBrowser.selectedTab, "The search result tab is shown");
+        waitForFocus(finish);
+      }, win);
 
-  afterAllTabItemsUpdated(function() { 
-    let contentWindow = document.getElementById("tab-view").contentWindow;
-    testOne(contentWindow);
+      // use the tabview menu (the same as pressing cmd/ctrl + e)
+      win.document.getElementById("menu_tabview").doCommand();
+    };
+
+    whenSearchEnabled(onSearchEnabled);
+    EventUtils.synthesizeKey("VK_SLASH", {}, cw);
+  };
+
+  whenTabViewIsHidden(function () {
+    showTabView(onTabViewShown, win);
+  }, win);
+
+  // click on the + button
+  let groupItem = createEmptyGroupItem(cw, 300, 300, 200);
+  let newTabButton = groupItem.container.getElementsByClassName("newTabButton");
+  ok(newTabButton[0], "New tab button exists");
+
+  EventUtils.sendMouseEvent({type: "click"}, newTabButton[0], cw);
+}
+
+function whenSearchEnabledAndDisabled(callback) {
+  whenSearchEnabled(function () {
+    whenSearchDisabled(callback);
+    cw.hideSearch();
   });
 }
 
-function testOne(contentWindow) {
-  onSearchEnabledAndDisabled(contentWindow, function() {
-    testTwo(contentWindow); 
-  });
-  // press cmd/ctrl F
-  EventUtils.synthesizeKey("f", { accelKey: true });
-}
-
-function testTwo(contentWindow) {
-  onSearchEnabledAndDisabled(contentWindow, function() { 
-    testThree(contentWindow);
-  });
-  // press /
-  EventUtils.synthesizeKey("VK_SLASH", { type: "keydown" }, contentWindow);
+function whenSearchEnabled(callback) {
+  cw.addEventListener("tabviewsearchenabled", function onSearchEnabled() {
+    cw.removeEventListener("tabviewsearchenabled", onSearchEnabled, false);
+    callback();
+  }, false);
 }
 
-function testThree(contentWindow) {
-  let groupItem = createEmptyGroupItem(contentWindow, 200);
-
-  let onTabViewHidden = function() {
-    window.removeEventListener("tabviewhidden", onTabViewHidden, false);
-    TabView.toggle();
-  };
-  let onTabViewShown = function() {
-    window.removeEventListener("tabviewshown", onTabViewShown, false);
-
-    is(contentWindow.UI.getActiveTab(), groupItem.getChild(0), 
-       "The active tab is newly created tab item");
-
-    let onSearchEnabled = function() {
-      contentWindow.removeEventListener(
-        "tabviewsearchenabled", onSearchEnabled, false);
-
-      let searchBox = contentWindow.iQ("#searchbox");
-
-      ok(contentWindow.document.hasFocus() && 
-         contentWindow.document.activeElement == searchBox[0], 
-         "The search box has focus");
-      searchBox.val(newTabOne._tabViewTabItem.$tabTitle[0].innerHTML);
-
-      contentWindow.performSearch();
-
-      let checkSelectedTab = function() {
-        window.removeEventListener("tabviewhidden", checkSelectedTab, false);
-        is(newTabOne, gBrowser.selectedTab, "The search result tab is shown");
-        cleanUpAndFinish(groupItem.getChild(0), contentWindow);
-      };
-      window.addEventListener("tabviewhidden", checkSelectedTab, false);
-
-      // use the tabview menu (the same as pressing cmd/ctrl + e)
-      document.getElementById("menu_tabview").doCommand();
-   };
-   contentWindow.addEventListener("tabviewsearchenabled", onSearchEnabled, false);
-   EventUtils.synthesizeKey("VK_SLASH", { type: "keydown" }, contentWindow);
-  };
-  window.addEventListener("tabviewhidden", onTabViewHidden, false);
-  window.addEventListener("tabviewshown", onTabViewShown, false);
-  
-  // click on the + button
-  let newTabButton = groupItem.container.getElementsByClassName("newTabButton");
-  ok(newTabButton[0], "New tab button exists");
-
-  EventUtils.sendMouseEvent({ type: "click" }, newTabButton[0], contentWindow);
+function whenSearchDisabled(callback) {
+  cw.addEventListener("tabviewsearchdisabled", function onSearchDisabled() {
+    cw.removeEventListener("tabviewsearchdisabled", onSearchDisabled, false);
+    callback();
+  }, false);
 }
-
-function onSearchEnabledAndDisabled(contentWindow, callback) {
-  let onSearchEnabled = function() {
-    contentWindow.removeEventListener(
-      "tabviewsearchenabled", onSearchEnabled, false);
-    contentWindow.addEventListener("tabviewsearchdisabled", onSearchDisabled, false);
-    contentWindow.hideSearch();
-  }
-  let onSearchDisabled = function() {
-    contentWindow.removeEventListener(
-      "tabviewsearchdisabled", onSearchDisabled, false);
-    callback();
-  }
-  contentWindow.addEventListener("tabviewsearchenabled", onSearchEnabled, false);
-}
-
-function cleanUpAndFinish(tabItem, contentWindow) {
-  gBrowser.selectedTab = originalTab;
-  gBrowser.removeTab(newTabOne);
-  gBrowser.removeTab(tabItem.tab);
-  
-  finish();
-}
-
-function createEmptyGroupItem(contentWindow, padding) {
-  let pageBounds = contentWindow.Items.getPageBounds();
-  pageBounds.inset(padding, padding);
-
-  let box = new contentWindow.Rect(pageBounds);
-  box.width = 300;
-  box.height = 300;
-
-  let emptyGroupItem = new contentWindow.GroupItem([], { bounds: box });
-
-  return emptyGroupItem;
-}
-
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug595601.js
@@ -0,0 +1,184 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+
+const TAB_STATE_NEEDS_RESTORE = 1;
+const TAB_STATE_RESTORING = 2;
+
+let stateBackup = ss.getBrowserState();
+
+let state = {windows:[{tabs:[
+  // first group
+  {entries:[{url:"http://example.com#1"}],extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#1\",\"groupID\":2}"}},
+  {entries:[{url:"http://example.com#2"}],extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#2\",\"groupID\":2}"}},
+  {entries:[{url:"http://example.com#3"}],extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#3\",\"groupID\":2}"}},
+  {entries:[{url:"http://example.com#4"}],extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#4\",\"groupID\":2}"}},
+
+  // second group
+  {entries:[{url:"http://example.com#5"}],hidden:true,extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#5\",\"groupID\":1}"}},
+  {entries:[{url:"http://example.com#6"}],hidden:true,extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#6\",\"groupID\":1}"}},
+  {entries:[{url:"http://example.com#7"}],hidden:true,extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#7\",\"groupID\":1}"}},
+  {entries:[{url:"http://example.com#8"}],hidden:true,extData:{"tabview-tab":"{\"bounds\":{\"left\":20,\"top\":20,\"width\":20,\"height\":20},\"url\":\"http://example.com#8\",\"groupID\":1}"}}
+],selected:5,extData:{
+  "tabview-groups":"{\"nextID\":8,\"activeGroupId\":1}","tabview-group":"{\"1\":{\"bounds\":{\"left\":15,\"top\":10,\"width\":415,\"height\":367},\"userSize\":{\"x\":415,\"y\":367},\"title\":\"\",\"id\":1},\"2\":{\"bounds\":{\"left\":286,\"top\":488,\"width\":418,\"height\":313},\"title\":\"\",\"id\":2}}",
+  "tabview-ui":"{\"pageBounds\":{\"left\":0,\"top\":0,\"width\":940,\"height\":1075}}"
+}}]};
+
+function test() {
+  waitForExplicitFinish();
+
+  Services.prefs.setBoolPref("browser.sessionstore.restore_hidden_tabs", false);
+
+  TabsProgressListener.init();
+
+  registerCleanupFunction(function () {
+    TabsProgressListener.uninit();
+
+    Services.prefs.clearUserPref("browser.sessionstore.max_concurrent_tabs");
+    Services.prefs.clearUserPref("browser.sessionstore.restore_hidden_tabs");
+
+    ss.setBrowserState(stateBackup);
+  });
+
+  Services.prefs.setIntPref("browser.sessionstore.max_concurrent_tabs", 3);
+
+  TabView._initFrame(function () {
+    executeSoon(testRestoreWithHiddenTabs);
+  });
+}
+
+function testRestoreWithHiddenTabs() {
+  let checked = false;
+  let ssReady = false;
+  let tabsRestored = false;
+
+  let check = function () {
+    if (checked || !ssReady || !tabsRestored)
+      return;
+
+    checked = true;
+
+    is(gBrowser.tabs.length, 8, "there are now eight tabs");
+    is(gBrowser.visibleTabs.length, 4, "four visible tabs");
+
+    let cw = TabView.getContentWindow();
+    is(cw.GroupItems.groupItems.length, 2, "there are now two groupItems");
+
+    testSwitchToInactiveGroup();
+  }
+
+  whenSessionStoreReady(function () {
+    ssReady = true;
+    check();
+  });
+
+  TabsProgressListener.setCallback(function (needsRestore, isRestoring) {
+    if (4 < needsRestore)
+      return;
+
+    TabsProgressListener.unsetCallback();
+    is(needsRestore, 4, "4/8 tabs restored");
+
+    tabsRestored = true;
+    check();
+  });
+
+  ss.setBrowserState(JSON.stringify(state));
+}
+
+function testSwitchToInactiveGroup() {
+  let firstProgress = true;
+
+  TabsProgressListener.setCallback(function (needsRestore, isRestoring) {
+    if (firstProgress) {
+      firstProgress = false;
+      is(isRestoring, 3, "restoring 3 tabs concurrently");
+    } else {
+      ok(isRestoring < 4, "restoring max. 3 tabs concurrently");
+    }
+
+    if (needsRestore)
+      return;
+
+    TabsProgressListener.unsetCallback();
+
+    is(gBrowser.visibleTabs.length, 4, "four visible tabs");
+    waitForFocus(finish);
+  });
+
+  gBrowser.selectedTab = gBrowser.tabs[4];
+}
+
+function whenSessionStoreReady(callback) {
+  window.addEventListener("SSWindowStateReady", function onReady() {
+    window.removeEventListener("SSWindowStateReady", onReady, false);
+    executeSoon(callback);
+  }, false);
+}
+
+function countTabs() {
+  let needsRestore = 0, isRestoring = 0;
+  let windowsEnum = Services.wm.getEnumerator("navigator:browser");
+
+  while (windowsEnum.hasMoreElements()) {
+    let window = windowsEnum.getNext();
+    if (window.closed)
+      continue;
+
+    for (let i = 0; i < window.gBrowser.tabs.length; i++) {
+      let browser = window.gBrowser.tabs[i].linkedBrowser;
+      if (browser.__SS_restoreState == TAB_STATE_RESTORING)
+        isRestoring++;
+      else if (browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE)
+        needsRestore++;
+    }
+  }
+
+  return [needsRestore, isRestoring];
+}
+
+let TabsProgressListener = {
+  init: function () {
+    gBrowser.addTabsProgressListener(this);
+  },
+
+  uninit: function () {
+    this.unsetCallback();
+    gBrowser.removeTabsProgressListener(this);
+ },
+
+  setCallback: function (callback) {
+    this.callback = callback;
+  },
+
+  unsetCallback: function () {
+    delete this.callback;
+  },
+
+  onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
+    let isNetwork = aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK;
+    let isWindow = aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW;
+
+    if (!(this.callback && isNetwork && isWindow))
+      return;
+
+    let self = this;
+    let finalize = function () {
+      if (wasRestoring)
+        delete aBrowser.__wasRestoring;
+
+      self.callback.apply(null, countTabs());
+    };
+
+    let isRestoring = aBrowser.__SS_restoreState == TAB_STATE_RESTORING;
+    let wasRestoring = !aBrowser.__SS_restoreState && aBrowser.__wasRestoring;
+    let hasStopped = aStateFlags & Ci.nsIWebProgressListener.STATE_STOP;
+
+    if (isRestoring && !hasStopped)
+      aBrowser.__wasRestoring = true;
+
+    if (hasStopped && (isRestoring || wasRestoring))
+      finalize();
+  }
+}
--- a/browser/base/content/test/tabview/browser_tabview_bug624265.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug624265.js
@@ -33,16 +33,17 @@ function test() {
       gBrowser.removeTab(gBrowser.tabs[1]);
 
     hideTabView(function () {
       let callback = tests.shift();
 
       if (!callback)
         callback = finish;
 
+      assertOneSingleGroupItem();
       callback();
     });
   }
 
   // ----------
   // [624265] testing undo close tab
   let testUndoCloseTabs = function () {
     gBrowser.loadOneTab('http://mochi.test:8888/', {inBackground: true});
@@ -106,17 +107,17 @@ function test() {
         });
       });
     }
 
     // The executeSoon() call is really needed here because there's probably
     // some callback waiting to be fired after gBrowser.loadOneTab(). After
     // that the browser is in a state where loadURI() will create a new entry
     // in the session history (that is vital for back/forward functionality).
-    afterAllTabsLoaded(function () SimpleTest.executeSoon(continueTest));
+    afterAllTabsLoaded(function () executeSoon(continueTest));
   }
 
   // ----------
   // [624102] check state after return from private browsing
   let testPrivateBrowsing = function () {
     gBrowser.loadOneTab('http://mochi.test:8888/#1', {inBackground: true});
     gBrowser.loadOneTab('http://mochi.test:8888/#2', {inBackground: true});
 
@@ -185,15 +186,15 @@ function enterAndLeavePrivateBrowsing(ca
   function pbObserver(aSubject, aTopic, aData) {
     if (aTopic != "private-browsing-transition-complete")
       return;
 
     if (pb.privateBrowsingEnabled)
       pb.privateBrowsingEnabled = false;
     else {
       Services.obs.removeObserver(pbObserver, "private-browsing-transition-complete");
-      afterAllTabsLoaded(callback);
+      afterAllTabsLoaded(function () executeSoon(callback));
     }
   }
 
   Services.obs.addObserver(pbObserver, "private-browsing-transition-complete", false);
   pb.privateBrowsingEnabled = true;
 }
--- a/browser/base/content/test/tabview/browser_tabview_bug624727.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug624727.js
@@ -57,17 +57,20 @@ function test() {
     let [group1, group2] = cw.GroupItems.groupItems;
     assertOneTabInGroup(prefix, group1);
     assertOneTabInGroup(prefix, group2);
   }
 
   let testStateAfterEnteringPB = function () {
     let prefix = 'enter';
     ok(!pb.privateBrowsingEnabled, prefix + ': private browsing is disabled');
-    registerCleanupFunction(function () pb.privateBrowsingEnabled = false);
+    registerCleanupFunction(function () {
+      if (pb.privateBrowsingEnabled)
+        pb.privateBrowsingEnabled = false
+    });
 
     togglePrivateBrowsing(function () {
       assertTabViewIsHidden(prefix);
 
       showTabView(function () {
         assertNumberOfGroups(prefix, 1);
         assertNumberOfTabs(prefix, 1);
         assertOneTabInGroup(prefix, cw.GroupItems.groupItems[0]);
@@ -105,16 +108,18 @@ function test() {
   }
 
   waitForExplicitFinish();
   registerCleanupFunction(function () TabView.hide());
   assertValidPrerequisites('start');
 
   showTabView(function () {
     cw = TabView.getContentWindow();
+    assertNumberOfGroups('start', 1);
+
     createGroupItem();
 
     afterAllTabsLoaded(function () {
       // setup
       let groupItems = cw.GroupItems.groupItems;
       let [tabItem1, tabItem2, ] = groupItems[1].getChildren();
       gBrowser.pinTab(tabItem1.tab);
       gBrowser.pinTab(tabItem2.tab);
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug625195.js
@@ -0,0 +1,53 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  is(gBrowser.tabs.length, 1, "Only one tab exist");
+
+  let originalTab = gBrowser.tabs[0];
+
+  popup(originalTab);
+  ok(document.getElementById("context_closeTab").disabled, "The 'Close tab' menu item is disabled");
+  ok(document.getElementById("context_openTabInWindow").disabled, "The 'Move to New Window' menu item is disabled");
+
+  let newTabOne = gBrowser.addTab("about:blank", {skipAnimation: true});
+
+  waitForExplicitFinish();
+
+  showTabView(function() {
+    registerCleanupFunction(function () {
+      while (gBrowser.tabs.length > 1)
+        gBrowser.removeTab(gBrowser.tabs[1]);
+      TabView.hide();
+    });
+
+    let contentWindow = TabView.getContentWindow();
+    is(contentWindow.GroupItems.groupItems.length, 1, "Has one group only");
+
+    let tabItems = contentWindow.GroupItems.groupItems[0].getChildren();
+    ok(tabItems.length, 2, "There are two tabItems in this group");
+
+    whenTabViewIsHidden(function() {
+      popup(gBrowser.tabs[0]);
+
+      ok(!document.getElementById("context_closeTab").disabled, "The 'Close tab' menu item is enabled");
+      ok(!document.getElementById("context_openTabInWindow").disabled, "The 'Move to New Window' menu item is enabled");
+
+      let newTabTwo = gBrowser.selectedTab;
+      gBrowser.selected = originalTab;
+
+      gBrowser.removeTab(newTabOne);
+      gBrowser.removeTab(newTabTwo);
+
+      finish();
+    });
+    let newGroup = contentWindow.GroupItems.newGroup();
+    newGroup.newTab();
+  });
+}
+
+function popup(tab) {
+  document.popupNode = tab;
+  TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu"));
+}
+
--- a/browser/base/content/test/tabview/browser_tabview_bug629195.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug629195.js
@@ -104,11 +104,11 @@ function restore(groupId) {
         "tabview-group": 
           '{"' + groupId + '":{"bounds":{"left":202,"top":30,"width":455,"height":249},' + 
           '"userSize":null,"locked":{},"title":"","id":' + groupId +'}}',
         "tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":788,"height":548}}'
       }, sizemode:"normal"
     }]
   };
   let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
-  ss.setWindowState(win, JSON.stringify(newState), false);
+  ss.setWindowState(win, JSON.stringify(newState), true);
 }
 
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug643392.js
@@ -0,0 +1,56 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+
+let state = {
+  windows: [{
+    tabs: [{
+      entries: [{ url: "about:home" }],
+      hidden: true,
+      extData: {"tabview-tab": '{"url":"about:home","groupID":1,"bounds":{"left":20,"top":20,"width":20,"height":20}}'}
+    },{
+      entries: [{ url: "about:home" }],
+      hidden: false,
+      extData: {"tabview-tab": '{"url":"about:home","groupID":2,"bounds":{"left":20,"top":20,"width":20,"height":20}}'},
+    }],
+    selected: 2,
+    extData: {
+      "tabview-groups": '{"nextID":3,"activeGroupId":2}',
+      "tabview-group":
+        '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},"id":1},' +
+        '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},"id":2}}'
+    }
+  }]
+};
+
+function test() {
+  waitForExplicitFinish();
+
+  newWindowWithState(state, function (win) {
+    registerCleanupFunction(function () win.close());
+
+    is(win.gBrowser.tabs.length, 2, "two tabs");
+
+    let opts = {animate: true, byMouse: true};
+    win.gBrowser.removeTab(win.gBrowser.visibleTabs[0], opts);
+
+    let checkTabCount = function () {
+      if (win.gBrowser.tabs.length > 1) {
+        executeSoon(checkTabCount);
+        return;
+      }
+
+      is(win.gBrowser.tabs.length, 1, "one tab");
+
+      showTabView(function () {
+        let cw = win.TabView.getContentWindow();
+        is(cw.TabItems.items.length, 1, "one tabItem");
+
+        waitForFocus(finish);
+      }, win);
+    };
+
+    checkTabCount();
+  });
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug650573.js
@@ -0,0 +1,100 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+let stateBackup = ss.getBrowserState();
+
+function test() {
+  waitForExplicitFinish();
+
+  registerCleanupFunction(function () {
+    ss.setBrowserState(stateBackup);
+  });
+
+  TabView._initFrame(function() {
+    executeSoon(testRestoreNormal);
+  });
+}
+
+function testRestoreNormal() {
+  testRestore("normal", function () {
+    waitForBrowserState(JSON.parse(stateBackup), testRestorePinned);
+  });
+}
+
+function testRestorePinned() {
+  gBrowser.loadOneTab("about:blank", {inBackground: true});
+  gBrowser.pinTab(gBrowser.tabs[0]);
+
+  testRestore("pinned", function () {
+    waitForBrowserState(JSON.parse(stateBackup), testRestoreHidden);
+  });
+}
+
+function testRestoreHidden() {
+  let groupItem = createGroupItemWithBlankTabs(window, 20, 20, 20, 1);
+  let tabItem = groupItem.getChild(0);
+
+  hideGroupItem(groupItem, function () {
+    testRestore("hidden", function () {
+      isnot(tabItem.container.style.display, "none", "tabItem is visible");
+      waitForFocus(finish);
+    });
+  });
+}
+
+function testRestore(prefix, callback) {
+  waitForBrowserState(createBrowserState(), function () {
+    is(gBrowser.tabs.length, 2, prefix + ": two tabs restored");
+
+    let cw = TabView.getContentWindow();
+    is(cw.GroupItems.groupItems.length, 2, prefix + ": we have two groupItems");
+
+    let [groupItem1, groupItem2] = cw.GroupItems.groupItems;
+    is(groupItem1.id, "1st-group-id", prefix + ": groupItem1's ID is valid");
+    is(groupItem1.getChildren().length, 1, prefix + ": groupItem1 has one child");
+
+    is(groupItem2.id, "2nd-group-id", prefix + ": groupItem2's ID is valid");
+    is(groupItem2.getChildren().length, 1, prefix + ": groupItem2 has one child");
+
+    callback();
+  });
+}
+
+function waitForBrowserState(state, callback) {
+  window.addEventListener("SSWindowStateReady", function onReady() {
+    window.removeEventListener("SSWindowStateReady", onReady, false);
+    executeSoon(callback);
+  }, false);
+
+  ss.setBrowserState(JSON.stringify(state));
+}
+
+function createBrowserState() {
+  let bounds = {left: 20, top: 20, width: 20, height: 20};
+
+  let tabViewGroups = {nextID: 99, activeGroupId: 1};
+  let tabViewGroup = {
+    "1st-group-id": {bounds: bounds, title: "new group 1", id: "1st-group-id"},
+    "2nd-group-id": {bounds: bounds, title: "new group 2", id: "2nd-group-id"}
+  };
+
+  let tab1Data = {bounds: bounds, url: "about:robots", groupID: "2nd-group-id"};
+  let tab1 = {
+    entries: [{url: "about:robots"}],
+    extData: {"tabview-tab": JSON.stringify(tab1Data)}
+  };
+
+  let tab2Data = {bounds: bounds, url: "about:mozilla", groupID: "1st-group-id"};
+  let tab2 = {
+    entries: [{url: "about:mozilla"}],
+    extData: {"tabview-tab": JSON.stringify(tab2Data)}
+  };
+
+  return {windows: [{
+    tabs: [tab1, tab2],
+    selected: 1,
+    extData: {"tabview-groups": JSON.stringify(tabViewGroups),
+    "tabview-group": JSON.stringify(tabViewGroup)}
+  }]};
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug656778.js
@@ -0,0 +1,141 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  registerCleanupFunction(function () {
+    Services.prefs.clearUserPref(TabView.PREF_FIRST_RUN);
+    Services.prefs.clearUserPref(TabView.PREF_STARTUP_PAGE);
+    Services.prefs.clearUserPref(TabView.PREF_RESTORE_ENABLED_ONCE);
+  });
+
+  let assertBoolPref = function (pref, value) {
+    is(Services.prefs.getBoolPref(pref), value, pref + " is " + value);
+  };
+
+  let assertIntPref = function (pref, value) {
+    is(Services.prefs.getIntPref(pref), value, pref + " is " + value);
+  };
+
+  let setPreferences = function (startupPage, firstRun, enabledOnce) {
+    Services.prefs.setIntPref(TabView.PREF_STARTUP_PAGE, startupPage);
+    Services.prefs.setBoolPref(TabView.PREF_FIRST_RUN, firstRun);
+    Services.prefs.setBoolPref(TabView.PREF_RESTORE_ENABLED_ONCE, enabledOnce);
+  };
+
+  let assertPreferences = function (startupPage, firstRun, enabledOnce) {
+    assertIntPref(TabView.PREF_STARTUP_PAGE, startupPage);
+    assertBoolPref(TabView.PREF_FIRST_RUN, firstRun);
+    assertBoolPref(TabView.PREF_RESTORE_ENABLED_ONCE, enabledOnce);
+  };
+
+  let next = function () {
+    if (tests.length == 0) {
+      waitForFocus(finish);
+      return;
+    }
+
+    let test = tests.shift();
+    info("running " + test.name + "...");
+    test();
+  };
+
+  // State:
+  // Panorama was already used before (firstUseExperienced = true) but session
+  // restore is deactivated. We did not automatically enable SR, yet.
+  //
+  // Expected result:
+  // When entering Panorma session restore will be enabled and a notification
+  // banner is shown.
+  let test1 = function test1() {
+    setPreferences(1, true, false);
+
+    newWindowWithTabView(function (win) {
+      assertPreferences(3, true, true);
+
+      win.close();
+      next();
+    });
+  };
+
+  // State:
+  // Panorama has not been used before (firstUseExperienced = false) and session
+  // restore is deactivated. We did not automatically enable SR, yet. That state
+  // is equal to starting the browser the first time.
+  //
+  // Expected result:
+  // When entering Panorma nothing happens. When we detect that Panorama is
+  // really used (firstUseExperienced = true) we notify that session restore
+  // is now enabled.
+  let test2 = function test2() {
+    setPreferences(1, false, false);
+
+    newWindowWithTabView(function (win) {
+      assertPreferences(1, false, false);
+
+      win.TabView.firstUseExperienced = true;
+
+      assertPreferences(3, true, true);
+
+      win.close();
+      next();
+    });
+  };
+
+  // State:
+  // Panorama was already used before (firstUseExperienced = true) and session
+  // restore is activated. We did not automatically enable SR, yet.
+  //
+  // Expected result:
+  // When entering Panorama nothing happens because session store is already
+  // enabled so there's no reason to notify.
+  let test3 = function test3() {
+    setPreferences(3, true, false);
+
+    newWindowWithTabView(function (win) {
+      assertPreferences(3, true, true);
+
+      win.close();
+      next();
+    });
+  };
+
+  // State:
+  // Panorama was already used before (firstUseExperienced = true) and session
+  // restore has been automatically activated.
+  //
+  // Expected result:
+  // When entering Panorama nothing happens.
+  let test4 = function test4() {
+    setPreferences(3, true, true);
+
+    newWindowWithTabView(function (win) {
+      assertPreferences(3, true, true);
+
+      win.close();
+      next();
+    });
+  };
+
+  // State:
+  // Panorama was already used before (firstUseExperienced = true) and session
+  // restore has been automatically activated. Session store was afterwards
+  // disabled by the user so we won't touch that again.
+  //
+  // Expected result:
+  // When entering Panorama nothing happens and we didn't enable session restore.
+  let test5 = function test5() {
+    setPreferences(1, true, true);
+
+    newWindowWithTabView(function (win) {
+      assertPreferences(1, true, true);
+
+      win.close();
+      next();
+    });
+  };
+
+  let tests = [test1, test2, test3, test4, test5];
+  next();
+}
--- a/browser/base/content/test/tabview/head.js
+++ b/browser/base/content/test/tabview/head.js
@@ -88,38 +88,48 @@ function newWindowWithTabView(shownCallb
     win.addEventListener("tabviewshown", onShown, false);
     win.TabView.toggle();
   }
   win.addEventListener("load", onLoad, false);
 }
 
 // ----------
 function afterAllTabsLoaded(callback, win) {
+  const TAB_STATE_NEEDS_RESTORE = 1;
+
   win = win || window;
 
   let stillToLoad = 0;
+  let restoreHiddenTabs = Services.prefs.getBoolPref(
+                          "browser.sessionstore.restore_hidden_tabs");
 
   function onLoad() {
     this.removeEventListener("load", onLoad, true);
     stillToLoad--;
     if (!stillToLoad)
       callback();
   }
 
   for (let a = 0; a < win.gBrowser.tabs.length; a++) {
-    let browser = win.gBrowser.tabs[a].linkedBrowser;
-    if (browser.contentDocument.readyState != "complete" ||
+    let tab = win.gBrowser.tabs[a];
+    let browser = tab.linkedBrowser;
+
+    let isRestorable = !(tab.hidden && !restoreHiddenTabs &&
+                         browser.__SS_restoreState &&
+                         browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE);
+
+    if (isRestorable && browser.contentDocument.readyState != "complete" ||
         browser.webProgress.isLoadingDocument) {
       stillToLoad++;
       browser.addEventListener("load", onLoad, true);
     }
   }
 
   if (!stillToLoad)
-    callback();
+    executeSoon(callback);
 }
 
 // ----------
 function showTabView(callback, win) {
   win = win || window;
 
   if (win.TabView.isVisible()) {
     callback();
@@ -256,8 +266,38 @@ function unhideGroupItem(groupItem, call
   }
 
   groupItem.addSubscriber(groupItem, "groupShown", function () {
     groupItem.removeSubscriber(groupItem, "groupShown");
     callback();
   });
   groupItem._unhide();
 }
+
+// ----------
+function whenWindowLoaded(win, callback) {
+  win.addEventListener("load", function onLoad() {
+    win.removeEventListener("load", onLoad, false);
+    executeSoon(callback);
+  }, false);
+}
+
+// ----------
+function whenWindowStateReady(win, callback) {
+  win.addEventListener("SSWindowStateReady", function onReady() {
+    win.removeEventListener("SSWindowStateReady", onReady, false);
+    executeSoon(callback);
+  }, false);
+}
+
+// ----------
+function newWindowWithState(state, callback) {
+  let opts = "chrome,all,dialog=no,height=800,width=800";
+  let win = window.openDialog(getBrowserURL(), "_blank", opts);
+
+  whenWindowLoaded(win, function () {
+    ss.setWindowState(win, JSON.stringify(state), true);
+  });
+
+  whenWindowStateReady(win, function () {
+    afterAllTabsLoaded(function () callback(win), win);
+  });
+}
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -178,17 +178,17 @@
           }
           return returnValue;
         ]]></body>
       </method>
 
       <field name="_formattingEnabled">true</field>
       <method name="formatValue">
         <body><![CDATA[
-          if (!this._formattingEnabled)
+          if (!this._formattingEnabled || this.focused)
             return;
 
           let controller = this.editor.selectionController;
           let selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
           selection.removeAllRanges();
 
           let textNode = this.editor.rootElement.firstChild;
           let value = textNode.textContent;
@@ -311,19 +311,23 @@
             this.handleRevert();
             content.focus();
             gBrowser.loadOneTab(url, {
                                 postData: postData,
                                 inBackground: false,
                                 allowThirdPartyFixup: true});
             aTriggeringEvent.preventDefault();
             aTriggeringEvent.stopPropagation();
+          } else {
+            // Pass LOAD_FLAGS_DISALLOW_INHERIT_OWNER to prevent any loads from
+            // inheriting the currently loaded document's principal.
+            let flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
+                        Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
+            gBrowser.loadURIWithFlags(url, flags, null, null, postData);
           }
-          else
-            loadURI(url, null, postData, true /* allow third party fixup */);
 
           gBrowser.selectedBrowser.focus();
         ]]></body>
       </method>
 
       <method name="_canonizeURL">
         <parameter name="aTriggeringEvent"/>
         <body><![CDATA[
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -98,16 +98,18 @@ static RedirEntry kRedirMap[] = {
     nsIAboutModule::ALLOW_SCRIPT },
 #ifdef MOZ_SERVICES_SYNC
   { "sync-tabs", "chrome://browser/content/aboutSyncTabs.xul",
     nsIAboutModule::ALLOW_SCRIPT },
 #endif
   { "home", "chrome://browser/content/aboutHome.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
+  { "permissions", "chrome://browser/content/preferences/aboutPermissions.xul",
+    nsIAboutModule::ALLOW_SCRIPT },
 };
 static const int kRedirTotal = NS_ARRAY_LENGTH(kRedirMap);
 
 static nsCAutoString
 GetAboutModuleName(nsIURI *aURI)
 {
   nsCAutoString path;
   aURI->GetPath(path);
--- a/browser/components/build/nsBrowserCompsCID.h
+++ b/browser/components/build/nsBrowserCompsCID.h
@@ -41,43 +41,24 @@
 #ifdef XP_WIN
 #define NS_WINIEPROFILEMIGRATOR_CID \
 { 0xbc15c73d, 0xc05b, 0x497b, { 0xa3, 0x73, 0x4b, 0xae, 0x6c, 0x17, 0x86, 0x31 } }
 #endif
 
 #ifdef XP_MACOSX
 #define NS_SAFARIPROFILEMIGRATOR_CID \
 { 0x29e3b139, 0xad19, 0x44f3, { 0xb2, 0xc2, 0xe9, 0xf1, 0x3b, 0xa2, 0xbb, 0xc6 } }
-
-#define NS_MACIEPROFILEMIGRATOR_CID \
-{ 0xf1a4e549, 0x5c4b, 0x41ff, { 0xb5, 0xe3, 0xeb, 0x87, 0xae, 0x31, 0x41, 0x9b } }
-
-#define NS_OMNIWEBPROFILEMIGRATOR_CID \
-{ 0xb80ae6d8, 0x766c, 0x43da, { 0x9c, 0x7a, 0xd, 0x82, 0x44, 0x52, 0x61, 0x6a } }
-
-#define NS_CAMINOPROFILEMIGRATOR_CID \
-{ 0x01d88ea9, 0x0feb, 0x495e, { 0x8c, 0x9b, 0x41, 0x65, 0x99, 0x55, 0x52, 0x65 } }
-
-#define NS_ICABPROFILEMIGRATOR_CID \
-{ 0xf394a036, 0xc5e1, 0x46d8, { 0x99, 0x39, 0x6b, 0x35, 0xe1, 0x13, 0x0a, 0x27 } }
-
 #endif
 
 #define NS_OPERAPROFILEMIGRATOR_CID \
 { 0xf34ff792, 0x722e, 0x4490, { 0xb1, 0x95, 0x47, 0xd2, 0x42, 0xed, 0xca, 0x1c } }
 
-#define NS_DOGBERTPROFILEMIGRATOR_CID \
-{ 0x24f92fae, 0xf793, 0x473b, { 0x80, 0x61, 0x71, 0x34, 0x8, 0xbd, 0x11, 0xd5 } }
-
 #define NS_SEAMONKEYPROFILEMIGRATOR_CID \
 { 0x9a28ffa7, 0xe6ef, 0x4b52, { 0xa1, 0x27, 0x6a, 0xd9, 0x51, 0xde, 0x8e, 0x9b } }
 
-#define NS_PHOENIXPROFILEMIGRATOR_CID \
-{ 0x78481e4a, 0x50e4, 0x4489, { 0xb6, 0x8a, 0xef, 0x82, 0x67, 0xe, 0xd6, 0x3f } }
-
 #define NS_SHELLSERVICE_CID \
 { 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }
 
 #define NS_SHELLSERVICE_CONTRACTID \
   "@mozilla.org/browser/shell-service;1"
 
 #define NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID \
 { 0x7a024bcf, 0xedd5, 0x4d9a, { 0x86, 0x14, 0xd4, 0x4b, 0xe1, 0xda, 0xda, 0xd3 } }
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -45,30 +45,24 @@
 #include "nsWindowsShellService.h"
 #elif defined(XP_MACOSX)
 #include "nsMacShellService.h"
 #elif defined(MOZ_WIDGET_GTK2)
 #include "nsGNOMEShellService.h"
 #endif
 
 #include "nsProfileMigrator.h"
-#include "nsDogbertProfileMigrator.h"
 #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)
 #include "nsSafariProfileMigrator.h"
-#include "nsOmniWebProfileMigrator.h"
-#include "nsMacIEProfileMigrator.h"
-#include "nsCaminoProfileMigrator.h"
-#include "nsICabProfileMigrator.h"
 #endif
 
 #include "rdf.h"
 #include "nsFeedSniffer.h"
 #include "AboutRedirector.h"
 #include "nsIAboutModule.h"
 
 #include "nsPrivateBrowsingServiceWrapper.h"
@@ -82,31 +76,25 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(Directory
 #if defined(XP_WIN)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
 #elif defined(MOZ_WIDGET_GTK2)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
 
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator)
 #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)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafariProfileMigrator)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsOmniWebProfileMigrator)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacIEProfileMigrator)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsCaminoProfileMigrator)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsICabProfileMigrator)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrivateBrowsingServiceWrapper, Init)
 
 NS_DEFINE_NAMED_CID(NS_BROWSERDIRECTORYPROVIDER_CID);
 #if defined(XP_WIN)
@@ -117,26 +105,20 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID)
 NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
 NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_FIREFOX_PROFILEMIGRATOR_CID);
 #if defined(XP_WIN) && !defined(__MINGW32__)
 NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
 #elif defined(XP_MACOSX)
 NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_SAFARIPROFILEMIGRATOR_CID);
-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
-NS_DEFINE_NAMED_CID(NS_DOGBERTPROFILEMIGRATOR_CID);
-NS_DEFINE_NAMED_CID(NS_PHOENIXPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID);
 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)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
 #elif defined(MOZ_WIDGET_GTK2)
@@ -145,26 +127,20 @@ static const mozilla::Module::CIDEntry k
     { &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
     { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
     { &kNS_FIREFOX_PROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
 #if defined(XP_WIN) && !defined(__MINGW32__)
     { &kNS_WINIEPROFILEMIGRATOR_CID, false, NULL, nsIEProfileMigratorConstructor },
 #elif defined(XP_MACOSX)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
     { &kNS_SAFARIPROFILEMIGRATOR_CID, false, NULL, nsSafariProfileMigratorConstructor },
-    { &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
-    { &kNS_DOGBERTPROFILEMIGRATOR_CID, false, NULL, nsDogbertProfileMigratorConstructor },
-    { &kNS_PHOENIXPROFILEMIGRATOR_CID, false, NULL, nsPhoenixProfileMigratorConstructor },
     { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
     { &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
     { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
     { NS_BROWSERDIRECTORYPROVIDER_CONTRACTID, &kNS_BROWSERDIRECTORYPROVIDER_CID },
 #if defined(XP_WIN)
@@ -181,32 +157,27 @@ static const mozilla::Module::ContractID
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
 #ifdef MOZ_SERVICES_SYNC
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
 #endif
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
+    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
     { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_FIREFOX_PROFILEMIGRATOR_CID },
 #if defined(XP_WIN) && !defined(__MINGW32__)
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "ie", &kNS_WINIEPROFILEMIGRATOR_CID },
 #elif defined(XP_MACOSX)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "safari", &kNS_SAFARIPROFILEMIGRATOR_CID },
-    { 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
-    { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "dogbert", &kNS_DOGBERTPROFILEMIGRATOR_CID },
-    { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "phoenix", &kNS_PHOENIXPROFILEMIGRATOR_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
     { NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
     { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kBrowserCategories[] = {
     { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "browser-directory-provider", NS_BROWSERDIRECTORYPROVIDER_CONTRACTID },
     { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
new file mode 100644
--- /dev/null
+++ b/browser/components/dirprovider/tests/unit/xpcshell.ini
@@ -0,0 +1,6 @@
+[DEFAULT]
+head = head_dirprovider.js
+tail = 
+
+[test_bookmark_pref.js]
+[test_keys.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/feeds/test/unit/xpcshell.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+head = head_feeds.js
+tail = 
+
+[test_355473.js]
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -123,18 +123,17 @@ var MigrationWizard = {
         try {
           var migrator = Components.classes[contractID].createInstance(kIMig);
         }
         catch (e) {
           dump("*** invalid contractID =" + contractID + "\n");
           return;
         }
 
-        if (migrator.sourceExists &&
-            !(suffix == "phoenix" && !this._autoMigrate)) {
+        if (migrator.sourceExists) {
           // Save this as the first selectable item, if we don't already have
           // one, or if it is the migrator that was passed to us.
           if (!selectedMigrator || this._source == suffix)
             selectedMigrator = group.childNodes[i];
         } else {
           // Hide this option
           group.childNodes[i].hidden = true;
         }
@@ -328,25 +327,21 @@ var MigrationWizard = {
 
     var singleStart = document.getElementById("homePageSingleStart");
     singleStart.setAttribute("label", mainStr);
     singleStart.setAttribute("value", "DEFAULT");
 
     var source = null;
     switch (this._source) {
       case "ie":
-      case "macie":
         source = "sourceNameIE";
         break;
       case "opera":
         source = "sourceNameOpera";
         break;
-      case "dogbert":
-        source = "sourceNameDogbert";
-        break;
       case "safari":
         source = "sourceNameSafari";
         break;
       case "seamonkey":
         source = "sourceNameSeamonkey";
         break;
     }
 
--- a/browser/components/migration/content/migration.xul
+++ b/browser/components/migration/content/migration.xul
@@ -63,53 +63,31 @@
     <description id="importAll" control="importSourceGroup">&importFromUnix.label;</description>
 #endif
     <description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description>
 
     <radiogroup id="importSourceGroup" align="start">
       <!-- If you are adding a migrator, please add the appropriate
            hooks to GetDefaultBrowserMigratorKey in
            browser/components/migration/src/nsProfileMigrator.cpp -->
-      <radio id="phoenix"   label="&importFromPhoenix.label;"   accesskey="&importFromPhoenix.accesskey;"/>
-#ifdef XP_UNIX
 #ifdef XP_MACOSX
       <radio id="safari"    label="&importFromSafari.label;"    accesskey="&importFromSafari.accesskey;"/>
-      <radio id="macie"     label="&importFromIE.label;"        accesskey="&importFromIE.accesskey;"/>
-<!-- XXXben - uncomment these as we write migrators for them
-      <radio id="camino"    label="&importFromCamino.label;"    accesskey="&importFromCamino.accesskey;"/>
-      <radio id="omniweb"   label="&importFromOmniWeb.label;"   accesskey="&importFromOmniWeb.accesskey;"/>
-      <radio id="icab"      label="&importFromICab.label;"      accesskey="&importFromICab.accesskey;"/>
--->
-      <radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
-      <radio id="dogbert"   label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
-#else
       <radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
-      <radio id="dogbert"   label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
       <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
-<!-- XXXben - uncomment these as we write migrators for them
-      <radio id="konqueror" label="&importFromKonqueror.label;" accesskey="&importFromKonqueror.accesskey;"/>
-      <radio id="epiphany"  label="&importFromEpiphany.label;"  accesskey="&importFromEpiphany.accesskey;"/>
-      <radio id="galeon"    label="&importFromGaleon.label;"    accesskey="&importFromGaleon.accesskey;"/>
-  -->
-#endif
-#endif
-#ifdef XP_WIN
+#elifdef XP_UNIX
+      <radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
+      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
+#elifdef XP_WIN
 #ifndef NO_IE_MIGRATOR
       <radio id="ie"        label="&importFromIE.label;"        accesskey="&importFromIE.accesskey;"/>
 #endif
       <radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
-      <radio id="dogbert"   label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
       <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
-#endif
-#ifndef XP_UNIX
-#ifndef XP_WIN
+#else
       <radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
-      <radio id="dogbert"   label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
-#endif
 #endif
       <radio id="fromfile"  label="&importFromHTMLFile.label;"  accesskey="&importFromHTMLFile.accesskey;" hidden="true"/>
       <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
     </radiogroup>
     <label id="noSources" hidden="true">&noMigrationSources.label;</label>
   </wizardpage>
 
   <wizardpage id="selectProfile" pageid="selectProfile" label="&selectProfile.title;"
--- a/browser/components/migration/src/Makefile.in
+++ b/browser/components/migration/src/Makefile.in
@@ -49,32 +49,26 @@ ifndef MOZ_MEMORY
 USE_STATIC_LIBS = 1
 endif
 
 
 CPPSRCS  = nsProfileMigrator.cpp \
            nsBrowserProfileMigratorUtils.cpp \
            nsNetscapeProfileMigratorBase.cpp \
            nsSeamonkeyProfileMigrator.cpp \
-           nsPhoenixProfileMigrator.cpp \
-           nsDogbertProfileMigrator.cpp \
            $(NULL)
 
 ifneq ($(OS_ARCH),OS2)
 CPPSRCS += nsOperaProfileMigrator.cpp
 endif
 
 ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
 CPPSRCS += nsIEProfileMigrator.cpp \
            $(NULL)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += nsSafariProfileMigrator.cpp \
-           nsMacIEProfileMigrator.cpp \
-           nsOmniWebProfileMigrator.cpp \
-           nsCaminoProfileMigrator.cpp \
-           nsICabProfileMigrator.cpp \
            $(NULL)
 endif            
 
 include $(topsrcdir)/config/rules.mk
 
deleted file mode 100644
--- a/browser/components/migration/src/nsCaminoProfileMigrator.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is The Browser Profile Migrator.
- *
- * The Initial Developer of the Original Code is Ben Goodger.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ben Goodger <ben@bengoodger.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsBrowserProfileMigratorUtils.h"
-#include "nsCaminoProfileMigrator.h"
-#include "nsIObserverService.h"
-#include "nsIProfileMigrator.h"
-#include "nsIServiceManager.h"
-#include "nsISupportsArray.h"
-#include "nsISupportsPrimitives.h"
-#include "nsServiceManagerUtils.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// nsCaminoProfileMigrator
-
-NS_IMPL_ISUPPORTS1(nsCaminoProfileMigrator, nsIBrowserProfileMigrator)
-
-nsCaminoProfileMigrator::nsCaminoProfileMigrator()
-{
-  mObserverService = do_GetService("@mozilla.org/observer-service;1");
-}
-
-nsCaminoProfileMigrator::~nsCaminoProfileMigrator()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// nsIBrowserProfileMigrator
-
-NS_IMETHODIMP
-nsCaminoProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
-{
-  nsresult rv = NS_OK;
-
-  NOTIFY_OBSERVERS(MIGRATION_STARTED, nsnull);
-
-  NOTIFY_OBSERVERS(MIGRATION_ENDED, nsnull);
-
-  return rv;
-}
-
-NS_IMETHODIMP
-nsCaminoProfileMigrator::GetMigrateData(const PRUnichar* aProfile, 
-                                        PRBool aReplace, 
-                                        PRUint16* aResult)
-{
-  *aResult = 0; // XXXben implement me
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsCaminoProfileMigrator::GetSourceExists(PRBool* aResult)
-{
-  *aResult = PR_FALSE; // XXXben implement me
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsCaminoProfileMigrator::GetSourceHasMultipleProfiles(PRBool* aResult)
-{
-  *aResult = PR_FALSE;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsCaminoProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
-{
-  *aResult = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsCaminoProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
-{
-  aResult.Truncate();
-  return NS_OK;
-}
-///////////////////////////////////////////////////////////////////////////////
-// nsCaminoProfileMigrator
-
deleted file mode 100644
--- a/browser/components/migration/src/nsCaminoProfileMigrator.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is The Browser Profile Migrator.
- *
- * The Initial Developer of the Original Code is Ben Goodger.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ben Goodger <ben@bengoodger.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef caminoprofilemigrator___h___
-#define caminoprofilemigrator___h___
-
-#include "nsIBrowserProfileMigrator.h"
-#include "nsIObserverService.h"
-#include "nsISupportsArray.h"
-#include "nsStringAPI.h"
-
-class nsCaminoProfileMigrator : public nsIBrowserProfileMigrator
-{
-public:
-  NS_DECL_NSIBROWSERPROFILEMIGRATOR
-  NS_DECL_ISUPPORTS
-
-  nsCaminoProfileMigrator();
-  virtual ~nsCaminoProfileMigrator();
-
-protected:
-
-private:
-  nsCOMPtr<nsIObserverService> mObserverService;
-};
- 
-#endif
deleted file mode 100644
--- a/browser/components/migration/src/nsDogbertProfileMigrator.cpp
+++ /dev/null
@@ -1,672 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is The Browser Profile Migrator.
- *
- * The Initial Developer of the Original Code is Ben Goodger.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ben Goodger <ben@bengoodger.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsAppDirectoryServiceDef